Ahh here we go. Just read the struts 2.0 -> 2.1 migration guide and saw this:

"The default action extension list (struts.action.extension) has changed from just 'action' to 'action' plus "" (no extension). If your application has servlets or other requests that have no extension then they will be mistaken as actions and you will get a "There is no Action mapped for ..." exception like below."

This explains the difference with regard to handling the mentioned URIs. So i can just do that:

<constant name="struts.action.extension" value="action" />

to get the old "2.0.x" bevaior. Unfortunately i created a custom ActionMapper the wont handle /services/* URIs. Hmmm. Lets see what i do now :)

---
regards
Marc Logemann
http://www.logemann.org
http://www.logentis.de




Am 03.04.2009 um 11:54 schrieb Marc Logemann:

Hi,

i have the following web.xml:

   <filter>
       <filter-name>struts2</filter-name>
<filter- class > org .apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</ filter-class>
   </filter>

   <filter-mapping>
       <filter-name>struts2</filter-name>
       <url-pattern>/*</url-pattern>
   </filter-mapping>

   <servlet>
       <servlet-name>CXFServlet</servlet-name>
       <servlet-class>
           org.apache.cxf.transport.servlet.CXFServlet
       </servlet-class>
       <load-on-startup>1</load-on-startup>
   </servlet>

   <servlet-mapping>
       <servlet-name>CXFServlet</servlet-name>
       <url-pattern>/services/*</url-pattern>
   </servlet-mapping>


No as you can see, i want all URLs resolved by Struts2 but / services/ should be handled by CXF. This worked with Struts 2.0.x and CXF but with latest Struts2, the Filter seems to be changed. Apart from the fact that i know use StrutsPrepareAndExecuteFilter instead of FilterDispatchter (using FilterDispatcher makes no difference regarding my problem), it seems that Struts2 now treats every URL as it should be processed by the framework, even without mapping and namespaces for it.

The ciritical point is the following code in the Struts filter:

ActionMapping mapping = prepare.findActionMapping(request, response);
           if (mapping == null) {
boolean handled = execute.executeStaticResourceRequest(request, response);
               if (!handled) {
                   chain.doFilter(request, response);
               }
           }


If it wouldnt find a mapping (in fact there is no mapping but the object is nevertheless != null) i think it would work because executeStaticResourceRequest() would return false and the normal processing chain of the Request would occur.


I cant change the struts2 url filter mapping beause that would break so much code of my existing app that i would rather modify the Filter not to handle "/service" urls. Again all this is because of a very poor web.xml (servlet) spec with regard to simple url-pattern without the chance to exclude something....

Any hints ??


---
regards
Marc Logemann
http://www.logemann.org
http://www.logentis.de





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



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

Reply via email to