3 Replies Latest reply on Oct 31, 2012 11:08 AM by kenfinni

    PortletRequest.getAttribute null

    jeromej

      Hi,

       

      We want to access to a request parameter (naming "pj") setting in a filter with PortletRequestWrapper.setAttribute method from managed-bean like below :

       

      portlet.xml :

      <init-param>
      <name>javax.portlet.faces.preserveActionParams</name>
      <value>true</value>
      </init-param>

      <filter>
      <filter-name>PortletFileUploadFilter</filter-name>
      <filter-class>fr.s2e.web.front.portlet.filtre.PortletFileUploadFilter</filter-class>
      <lifecycle>ACTION_PHASE</lifecycle>
      </filter>
      <filter-mapping>
      <filter-name>PortletFileUploadFilter</filter-name>
      <portlet-name>Portlet-demo</portlet-name>
      </filter-mapping>

       

      managed-bean class :

      FacesContext facesContext = FacesContext.getCurrentInstance();
      PortletRequest portletRequest = (PortletRequest) facesContext.getExternalContext().getRequest();
      FileItem fileItem = (FileItem) portletRequest.getAttribute("pj");

       

      But "portletRequest.getAttribute("pj")" is null.

      So, what did we miss? or is there another way to get it?

       

      With : JSF : 2.1.8, RF : 4.2.3.Final, PB : 3.1.0.CR1, Gatein 3.2.4

        • 1. Re: PortletRequest.getAttribute null
          kenfinni

          Not sure what the issue might be.

           

          Sounds like the attribute isn't being set on the request, or the attribute is being namespaced to the portlet.  I'd check all the request attributes to see if there's an attribute that ends in "pj" and is prefixed with another name.

          • 2. Re: PortletRequest.getAttribute null
            jeromej

            We've already check the ends of all attributes and we find nothing with "pj" in all the request map attributes.

            • 3. Re: PortletRequest.getAttribute null
              kenfinni

              There's nothing that PortletBridge does that would prevent a valid object in the request from being retrieved from it in the way you described above.

               

              It sounds like there is potentially a problem with the portal or some other issue.  Have you tried the same thing on a more recent GateIn version? I'd also suggest posting on the GateIn forums for the portlet filter issue.