You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Unmesh joshi <un...@hotmail.com> on 2009/10/07 19:58:20 UTC

Servlet filter as front controller

Hi,Struts2 uses servlet filter org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter as front controller, rather than having a servlet act as front controller. Is there any specific advantage of using servlet filter over servlet (as in struts 1.1)?
Thanks,Unmesh
 		 	   		  
_________________________________________________________________
Great events make grand headlines – read them all on MSN India
http://in.msn.com

Re: Servlet filter as front controller

Posted by Struts Two <st...@yahoo.ca>.
Dummy servlet should do it (as mentioned by WES), I know this in case of WAS where you are going to create plugin-xml file for your HTTP server. Without a dummy servlet mapped to *.action or *.do, Http server would fail to route any request that is mapped to *.action or *.do in the filter.

--- On Thu, 10/8/09, Wes Wannemacher <we...@wantii.com> wrote:

> From: Wes Wannemacher <we...@wantii.com>
> Subject: Re: Servlet filter as front controller
> To: "Struts Users Mailing List" <us...@struts.apache.org>
> Received: Thursday, October 8, 2009, 1:15 PM
> I was thinking about this issue
> recently and wondered if simply
> mapping a do-nothing servlet to * would workaround this...
> I thought
> about trying it, but I only have tomcat and jetty handy for
> testing,
> and this doesn't seem to be an issue on either one.
> Although, a
> do-nothing servlet would probably solve the other problem
> of mapping
> welcome-files to index.action.
> 
> -Wes
> 
> On Thu, Oct 8, 2009 at 8:36 AM, Struts Two <st...@yahoo.ca>
> wrote:
> > I have mentioned this before in another thread that
> Struts2 is breaking Servlet specification 2.4 in this
> regard, but have heard no comment on it which means two
> things either I have a point or I am way off.
> >
> > In Servlet specification 2.4 filters are not supposed
> to be accessed directly as a resource. And anything other
> than a jsp page need to have a Servlet mapping in order to
> make it accessible (as per specification).
> >
> > Struts 1 had ActionServlet to which *.action or *.do
> mapping was done. This sort of deviation from sped is
> causing some folks issues when it comes to using some
> appservers that follow the spec and you have to resort to
> all sort of hacks to get around it.
> >
> > --- On Wed, 10/7/09, Arthur Neves <ar...@gmail.com>
> wrote:
> >
> >> From: Arthur Neves <ar...@gmail.com>
> >> Subject: Re: Servlet filter as front controller
> >> To: "Struts Users Mailing List" <us...@struts.apache.org>
> >> Received: Wednesday, October 7, 2009, 11:57 PM
> >> With the filter struts2 can intercept
> >> all request.
> >>
> >> I think it's more difficult to do thinks like,
> the
> >> namespace struct with a
> >> servlet,i dont have sure though.
> >>
> >>
> >>
> >> On Wed, Oct 7, 2009 at 2:58 PM, Unmesh joshi
> <un...@hotmail.com>wrote:
> >>
> >> >
> >> > Hi,Struts2 uses servlet filter
> >> >
> >>
> org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter
> >> as front
> >> > controller, rather than having a servlet act
> as front
> >> controller. Is there
> >> > any specific advantage of using servlet
> filter over
> >> servlet (as in struts
> >> > 1.1)?
> >> > Thanks,Unmesh
> >> >
> >> >
> >>
> _________________________________________________________________
> >> > Great events make grand headlines – read
> them all on
> >> MSN India
> >> > http://in.msn.com
> >> >
> >>
> >
> >
> >    
>  __________________________________________________________________
> > Ask a question on any topic and get answers from real
> people. Go to Yahoo! Answers and share what you know at http://ca.answers.yahoo.com
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
> 
> 
> 
> -- 
> Wes Wannemacher
> 
> Head Engineer, WanTii, Inc.
> Need Training? Struts, Spring, Maven, Tomcat...
> Ask me for a quote!
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 


      __________________________________________________________________
Looking for the perfect gift? Give the gift of Flickr! 

http://www.flickr.com/gift/

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


Re: Servlet filter as front controller

Posted by Wes Wannemacher <we...@wantii.com>.
I was thinking about this issue recently and wondered if simply
mapping a do-nothing servlet to * would workaround this... I thought
about trying it, but I only have tomcat and jetty handy for testing,
and this doesn't seem to be an issue on either one. Although, a
do-nothing servlet would probably solve the other problem of mapping
welcome-files to index.action.

-Wes

On Thu, Oct 8, 2009 at 8:36 AM, Struts Two <st...@yahoo.ca> wrote:
> I have mentioned this before in another thread that Struts2 is breaking Servlet specification 2.4 in this regard, but have heard no comment on it which means two things either I have a point or I am way off.
>
> In Servlet specification 2.4 filters are not supposed to be accessed directly as a resource. And anything other than a jsp page need to have a Servlet mapping in order to make it accessible (as per specification).
>
> Struts 1 had ActionServlet to which *.action or *.do mapping was done. This sort of deviation from sped is causing some folks issues when it comes to using some appservers that follow the spec and you have to resort to all sort of hacks to get around it.
>
> --- On Wed, 10/7/09, Arthur Neves <ar...@gmail.com> wrote:
>
>> From: Arthur Neves <ar...@gmail.com>
>> Subject: Re: Servlet filter as front controller
>> To: "Struts Users Mailing List" <us...@struts.apache.org>
>> Received: Wednesday, October 7, 2009, 11:57 PM
>> With the filter struts2 can intercept
>> all request.
>>
>> I think it's more difficult to do thinks like, the
>> namespace struct with a
>> servlet,i dont have sure though.
>>
>>
>>
>> On Wed, Oct 7, 2009 at 2:58 PM, Unmesh joshi <un...@hotmail.com>wrote:
>>
>> >
>> > Hi,Struts2 uses servlet filter
>> >
>> org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter
>> as front
>> > controller, rather than having a servlet act as front
>> controller. Is there
>> > any specific advantage of using servlet filter over
>> servlet (as in struts
>> > 1.1)?
>> > Thanks,Unmesh
>> >
>> >
>> _________________________________________________________________
>> > Great events make grand headlines – read them all on
>> MSN India
>> > http://in.msn.com
>> >
>>
>
>
>      __________________________________________________________________
> Ask a question on any topic and get answers from real people. Go to Yahoo! Answers and share what you know at http://ca.answers.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>



-- 
Wes Wannemacher

Head Engineer, WanTii, Inc.
Need Training? Struts, Spring, Maven, Tomcat...
Ask me for a quote!

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


Re: Servlet filter as front controller

Posted by Struts Two <st...@yahoo.ca>.
I have mentioned this before in another thread that Struts2 is breaking Servlet specification 2.4 in this regard, but have heard no comment on it which means two things either I have a point or I am way off.

In Servlet specification 2.4 filters are not supposed to be accessed directly as a resource. And anything other than a jsp page need to have a Servlet mapping in order to make it accessible (as per specification).

Struts 1 had ActionServlet to which *.action or *.do mapping was done. This sort of deviation from sped is causing some folks issues when it comes to using some appservers that follow the spec and you have to resort to all sort of hacks to get around it.  

--- On Wed, 10/7/09, Arthur Neves <ar...@gmail.com> wrote:

> From: Arthur Neves <ar...@gmail.com>
> Subject: Re: Servlet filter as front controller
> To: "Struts Users Mailing List" <us...@struts.apache.org>
> Received: Wednesday, October 7, 2009, 11:57 PM
> With the filter struts2 can intercept
> all request.
> 
> I think it's more difficult to do thinks like, the
> namespace struct with a
> servlet,i dont have sure though.
> 
> 
> 
> On Wed, Oct 7, 2009 at 2:58 PM, Unmesh joshi <un...@hotmail.com>wrote:
> 
> >
> > Hi,Struts2 uses servlet filter
> >
> org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter
> as front
> > controller, rather than having a servlet act as front
> controller. Is there
> > any specific advantage of using servlet filter over
> servlet (as in struts
> > 1.1)?
> > Thanks,Unmesh
> >
> >
> _________________________________________________________________
> > Great events make grand headlines – read them all on
> MSN India
> > http://in.msn.com
> >
> 


      __________________________________________________________________
Ask a question on any topic and get answers from real people. Go to Yahoo! Answers and share what you know at http://ca.answers.yahoo.com

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


Re: Servlet filter as front controller

Posted by Arthur Neves <ar...@gmail.com>.
With the filter struts2 can intercept all request.

I think it's more difficult to do thinks like, the namespace struct with a
servlet,i dont have sure though.



On Wed, Oct 7, 2009 at 2:58 PM, Unmesh joshi <un...@hotmail.com>wrote:

>
> Hi,Struts2 uses servlet filter
> org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter as front
> controller, rather than having a servlet act as front controller. Is there
> any specific advantage of using servlet filter over servlet (as in struts
> 1.1)?
> Thanks,Unmesh
>
> _________________________________________________________________
> Great events make grand headlines – read them all on MSN India
> http://in.msn.com
>