0 Replies Latest reply on Dec 27, 2006 4:40 AM by Sridhar Krishnan

    Getting PortletPreferences in StrutsPortlet

    Sridhar Krishnan Newbie


      I am trying to obtain PortletPreferences from a Struts Action class as follows

      public ActionForward execute(ActionMapping mapping, ActionForm form,HttpServletRequest request, HttpServletResponse response) throws Exception {

      PortletRequest portRequest = (PortletRequest)request.getAttribute("javax.portlet.request");

      PortletPreferences prefs = renderRequest.getPreferences();

      System.out.println("The value of attribute is "+prefs.getValue("attribute1","default"));

      But all the time i get only default printed on the server console. The attribute1 has a value in the HSQL portal database.

      I ma accesing only after sucessful portal logging. Though i was unable to retreive the values i am able to set the value of this attribute.

      Can anyone let me know whats incorrect or wrong here.?

      Thanks & Regards