1 Reply Latest reply on Jul 23, 2009 10:16 AM by piergiorgiolucidi

    about portlet preference

    kiki2002d

      Hi,
      I have a question.
      I am a new of Jboss portal. Before that, i use liferay portal. I want to move a portlet to jboss portal. But the portlet preference does't work.

      in java code is:
      FacesContext fc = FacesContext.getCurrentInstance();
      ActionRequest req = (ActionRequest) fc.getExternalContext().getRequest();
      PortletPreferences p=req.getPreferences();
      String url="******";
      p.setValue("URL", url);
      p.store();

      Can I save some data in portlet with PortletPreferences object? And how?
      I use Jboss AS 4.2.3, jboss portal 2.7.2.
      Thanks!

        • 1. Re: about portlet preference
          piergiorgiolucidi

          You can try in this way:

          Object o = FacesContext.getCurrentInstance().getExternalContext().getRequest();
          PortletRequest request = (PortletRequest) o;
          PortletPreferences pp = request.getPreferences();
          pp.setValue(preferenceKey,value);
          pp.store();
          


          Hope this helps.