struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Benedict <pbened...@apache.org>
Subject Re: combining Struts1 and Struts2
Date Thu, 06 Dec 2007 12:51:14 GMT
Unlike Struts 1, Struts 2 wants your struts.xml in your 
src/main/resources -- top of the classpath, not in WEB-INF.

KWilmink wrote:
> Hello,
> 
> 
> I got a project that i want to migrate from Struts1 to Struts2. The project
> is quite a complex project though.
> 
> I started adding the jar files:
> * struts2-core-2.0.11.jar
> * ognl-2.6.11.jar
> * commons-logging.jar
> * freemarker-2.3.8.jar
> 
> Then i changed my web.xml file,
> i mapped actions wich end on .action over the dispatcher of Struts2:
> 
> <filter-mapping><filter-name>struts2</filter-name>
> 	<url-pattern>*.action</url-pattern>
> </filter-mapping>
> 
> i placed struts.xml into: WEB-INF/src/struts.xml
> 
> now i got all kind of Struts1 action wich happen first (and work) and then
> in the middle of the flow i want 1 action(getOwnerType) wich uses Struts2.
> This action is called with packageName/getOwnerType.action.
> But i get the error message's:
> 
> HTTP Status 404 - /applicationName/package/GetOwnerTypeAction.action
> 
> type Status report
> 
> message /applicationName/package/GetOwnerTypeAction.action
> 
> description The requested resource
> (/application/package/GetOwnerTypeAction.action) is not available.
> Apache Tomcat/5.5.25
> 
> I had some help with this i we talked about the web.xml, do we create 2
> servlets? One for struts1 and one for struts2? what is did is i added:
> <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>*.action</url-pattern>
> </filter-mapping>
> 
> to the excisting web.xml (this web xml is quite long and does char encoding
> and creates a servlet called Log4JConfig).
> 
> So probably it has to do with the web.xml, how can i use it to map request
> through a Struts1 dispatcher(if it end on .do) or map it through a struts2
> dispatcher (when it ends on .action)?
> 
> I really hope someone can help me out on this one!
> 
> thanks in advance
> 
> 
> 
> 

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


Mime
View raw message