You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bridges-user@portals.apache.org by at <an...@gmail.com> on 2008/01/29 12:49:14 UTC

Servlet Filter Problem

Hello,
I have converted a struts application in portlet using portlet bridge
for integration in liferay portal.
The application  filter path using the javax.servlet.Filter
	<filter-mapping>
		<filter-name>SecurityFilter</filter-name>
		<url-pattern>/customers/*</url-pattern>
	</filter-mapping>

But with this configurazione  the filter don't work if my application
is in a portlet context.
 Trying this configuration
<filter-mapping>
		<filter-name>SecurityFilter</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>

 The filter work but intercept all request.
How I can make it to work with the path that start with customers?


-- 
Antonio Talarico

---------------------------------------------------------------------
To unsubscribe, e-mail: bridges-user-unsubscribe@portals.apache.org
For additional commands, e-mail: bridges-user-help@portals.apache.org


Re: Servlet Filter Problem

Posted by Mark McLaren <ma...@gmail.com>.
Have you tried the Apache Portals Portlet Filter?

<http://portals.apache.org/bridges/multiproject/portals-bridges-portletfilter/index.html>

Since portlets are accessed by the Portal using cross context access
no URL is visited - so Servlet Filters do not work.

Hence you need to look for alternatives - such as the above pseudo
filter or you might be able to use a ServletRequestListener.

HTH

Mark

On Jan 29, 2008 3:19 PM, Cocula Remi <rc...@sopragroup.com> wrote:
> I also faced this problem.
>
> In my case, the filter is mapped on a servlet (instead of an Url).The portlet is also a struts application port.
> The filter is never invoked in a portlet context in Liferay 4.2 but when the application is invoqued as standalone (I mean with the application context name into the URL) the filter works.
>
> I finally gave up trying to use a filter in the portlet context because of this article (http://ml.osdir.com/jakarta.pluto.user/2004-07/msg00062.html) that explains that, even if portlets are packaged as complete J2EE with a web.xml descriptor, filters are not garanteed to work in a portlet context bacause it is not mentionned in the JSR168 specification. It may depend on the portlet container.
>
> Regards.
>
>
>
> -----Message d'origine-----
> De : at [mailto:antalarico@gmail.com]
> Envoyé : mardi 29 janvier 2008 12:49
> À : bridges-user@portals.apache.org
> Objet : Servlet Filter Problem
>
>
> Hello,
> I have converted a struts application in portlet using portlet bridge for integration in liferay portal.
> The application  filter path using the javax.servlet.Filter
>         <filter-mapping>
>                 <filter-name>SecurityFilter</filter-name>
>                 <url-pattern>/customers/*</url-pattern>
>         </filter-mapping>
>
> But with this configurazione  the filter don't work if my application is in a portlet context.
>  Trying this configuration
> <filter-mapping>
>                 <filter-name>SecurityFilter</filter-name>
>                 <url-pattern>/*</url-pattern>
>         </filter-mapping>
>
>  The filter work but intercept all request.
> How I can make it to work with the path that start with customers?
>
>
> --
> Antonio Talarico


-- 
"Paradoxically, the more time saving abstractions you are using the
more you actually have to know." - Simon Willison

---------------------------------------------------------------------
To unsubscribe, e-mail: bridges-user-unsubscribe@portals.apache.org
For additional commands, e-mail: bridges-user-help@portals.apache.org


RE: Servlet Filter Problem

Posted by Cocula Remi <rc...@sopragroup.com>.
I also faced this problem. 

In my case, the filter is mapped on a servlet (instead of an Url).The portlet is also a struts application port.
The filter is never invoked in a portlet context in Liferay 4.2 but when the application is invoqued as standalone (I mean with the application context name into the URL) the filter works.

I finally gave up trying to use a filter in the portlet context because of this article (http://ml.osdir.com/jakarta.pluto.user/2004-07/msg00062.html) that explains that, even if portlets are packaged as complete J2EE with a web.xml descriptor, filters are not garanteed to work in a portlet context bacause it is not mentionned in the JSR168 specification. It may depend on the portlet container.

Regards. 

 

-----Message d'origine-----
De : at [mailto:antalarico@gmail.com] 
Envoyé : mardi 29 janvier 2008 12:49
À : bridges-user@portals.apache.org
Objet : Servlet Filter Problem

Hello,
I have converted a struts application in portlet using portlet bridge for integration in liferay portal.
The application  filter path using the javax.servlet.Filter
	<filter-mapping>
		<filter-name>SecurityFilter</filter-name>
		<url-pattern>/customers/*</url-pattern>
	</filter-mapping>

But with this configurazione  the filter don't work if my application is in a portlet context.
 Trying this configuration
<filter-mapping>
		<filter-name>SecurityFilter</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>

 The filter work but intercept all request.
How I can make it to work with the path that start with customers?


--
Antonio Talarico

---------------------------------------------------------------------
To unsubscribe, e-mail: bridges-user-unsubscribe@portals.apache.org
For additional commands, e-mail: bridges-user-help@portals.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: bridges-user-unsubscribe@portals.apache.org
For additional commands, e-mail: bridges-user-help@portals.apache.org