my dog learned polymorphism*
The moose likes Struts and the fly likes integrate struts 2 actions in my existing struts 1.2 web app Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "integrate struts 2 actions in my existing struts 1.2 web app" Watch "integrate struts 2 actions in my existing struts 1.2 web app" New topic
Author

integrate struts 2 actions in my existing struts 1.2 web app

Sandy
Greenhorn

Joined: Apr 24, 2008
Posts: 1
I have to integrate struts 2 actions in my existing struts 1.2 web application.

I would have to use struts2 action in the flow of struts1 action.

My login page is using struts 1.2 action. Upon login, I come to home page. there is a link on home page. when I click on that link, I need to go to another jsp page. The later action has to be in struts 2.


I have added filter, filter mapping for struts 2 in web.xml.
--------------------------------------------------
<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>/*</url-pattern>
</filter-mapping>
-------------------------------

I have included struts.xml in the root of the project (under java source folder). This includes struts-config.xml (using struts 1.2.8) and struts-config-two.xml (using struts 2).



--> struts-config.xml is in web-inf

--> struts-config-two.xml is in the root of the project (under java source folder)



my struts-config-two.xml is :

-----------------------------------------------------------------



<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE struts PUBLIC

"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"

"http://struts.apache.org/dtds/struts-2.0.dtd">



<struts>



<package name="xxx" namespace="/xxx" extends="xxx-default">



<action name="testAction2"

class="x.y.z.presentation.test.TestAction2">



<result name="home"> /TestLink.jsp </result>

</action>

</package>



</struts>



--------------------------------------------------------------------------



In my TestLink.jsp, I am specifying :



<s:url id="viewURL" namespace="/xxx" action="testAction2" />

<s:a href=%{viewURL}> Test Link Home </s:a> Test Link



-------------------------------------------------------------------------------------

I am able to login to the app. but When I click on the link I get an error message : ERROR action.RequestProcessor - Invalid path was requested /xxx/TestAction.

Can you please help me to resolve this issue.

Please let me know the step by step procedure.

I have read the migration tutorial. but it didn't help me to resolve this issue.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: integrate struts 2 actions in my existing struts 1.2 web app
 
Similar Threads
Problem With I18n feature of Struts2
struts2 properties file reload
web.xml problem in struts2
Struts2 with RAD7
Struts2 Action problem Problem