0
votes

I have created a portlet that runs under Gatein on JBoss 7.2. (To be precise, this was a web app converted to a portlet.) I need two filters on my portlet, the Gatein CDI filter and the Primefaces Upload filter (since my portlet needs to handle uploads). In my portlet.xml file, I tried specifying the two filters like so:

<filter>  
    <filter-name>PortletCDIFilter</filter-name>  
    <filter-class>org.gatein.cdi.PortletCDIFilter</filter-class>  
    <lifecycle>ACTION_PHASE</lifecycle>  
    <lifecycle>EVENT_PHASE</lifecycle>  
    <lifecycle>RENDER_PHASE</lifecycle>  
    <lifecycle>RESOURCE_PHASE</lifecycle>  
</filter>  
<filter>
    <filter-name>PrimeFacesFileUploadFilter</filter-name>
    <filter-class>org.primefaces.webapp.filter.FileUploadFilter</filter-class>
    <lifecycle>ACTION_PHASE</lifecycle>  
    <lifecycle>EVENT_PHASE</lifecycle>  
    <lifecycle>RENDER_PHASE</lifecycle>  
    <lifecycle>RESOURCE_PHASE</lifecycle>  
</filter>
<filter-mapping>  
    <filter-name>PortletCDIFilter</filter-name>  
    <portlet-name>FleetManagementPortlet</portlet-name>  
</filter-mapping>
<filter-mapping>
    <filter-name>PrimeFaces FileUploadFilter</filter-name>
    <portlet-name>FleetManagementPortlet</portlet-name>
</filter-mapping>

However, when I try to access the portlet, I get an error in the log file saying that there is no portlet named FleetConnector.FleetManagementPortlet (my war file is FleetConnector.war). Interestingly, before I added the second filter and filter-mapping blocks, I did not get any error, even though the portlet name is the same.

I have not been able to find any example of the syntax to specify multiple filters in portlet.xml, so I'm not sure my syntax is correct. Any help would be appreciated.

1

1 Answers

0
votes

Okay, I found out what the problem with my configuration was. The PrimeFaces upload filter is for servlets - not for portlets. The API is different. There was an error in the log indicating that the filter did not have the correct API, but the last error shown indicated that the portlet name was incorrect, which was not the case. I will now search for an upload filter that works with portlets.