I think I was not very clear on what I meant by plugin. I would try to be more 
precise as some struts users have been experiencing the same problem and IBM 
has pointed out this is due Struts not conforming with 2.4 Spec.

Almost all production and staging environments using Websphere Application 
server have an (IBM) Http server that runs in front of Websphere. Requests that 
come to (IBM) Http Server are dispatched to either Websphere (dynamic content) 
or a resource on a file system. Http server uses a special xml file named 
"plugin.xml" to make that decision. This file is generated by Websphere 
application servers by parsing web.xml of deployed applications.

Now, If we have the following entry in the web.xml:

<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
</servlet>

<servlet-mapping>
  <servlet-name>action</servlet-name>
  <url-pattern>*.do</url-pattern>
</servlet-mapping>

A corresponding entry for <context-root>/*.do is created in the plugin file [as 
per spec 2.4 (Servlets can be accessed directly as resource)] and 
https(s)://<hostname>/<context-root>/*.do requests are correctly dispatched to 
Websphere container

However, if you have an entry like[as in struts 2.0 or 
StrutsPrepareAndExecuteFilter in 2.1]  :

<filter>
  <filter-name>struts2</filter-name>
  <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<filter-mapping>
   <filter-name>struts2</filter-name>
   <url-pattern>/*.do</url-pattern>
</filter-mapping>

This will be ignored during "plugin.xml" file generation as per 2.4 spec  
filters are not supposed to be accessed directly as a resource. This will 
result in "Page not found" error in http(s)://<hostname>/<context-root>/*.do.


--- On Tue, 6/23/09, Struts Two <struts...@yahoo.ca> wrote:

> From: Struts Two <struts...@yahoo.ca>
> Subject: Struts FilterDispatcher issue with regard to specification 2.4
> To: user@struts.apache.org
> Received: Tuesday, June 23, 2009, 8:07 PM
> 
> Hello All:
> 
> 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 which allowed for servlet
> mapping of *.action or *.do which could in turn be picked up
> by Websphere Applicton Server duing plugin generation to be
> used for http webserver.
> 
> However, in struts 2 filter mapping for *.action or *.do
> will not work anymore during plugin generation as it is not
> supported per 2.4 specification. This would make the
> application unaccessible though Http server.
> 
> I was wondering if someone can explain to me the rational
> to use DispatchFilter as opposed to a DispatchServlet in
> struts 2.
> 
> 
>      
> __________________________________________________________________
> Looking for the perfect gift? Give the gift of Flickr! 
> 
> http://www.flickr.com/gift/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 
> 


      __________________________________________________________________
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-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to