File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes how to modify struts-config.xml to migrate struts2? 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 "how to modify struts-config.xml to migrate struts2?" Watch "how to modify struts-config.xml to migrate struts2?" New topic
Author

how to modify struts-config.xml to migrate struts2?

Harshani Wickramarathna
Greenhorn

Joined: Nov 15, 2007
Posts: 28
Hi...
This is my struts-config.xml. How should I change this to migrate struts2? Do I need to create new struts.xml file and put it in src or is it ok to change the existing struts-config.xml to struts.xml?

Please help me...
---------
<form-beans>
<form-bean
name="AddressForm"
type="finalpackage.AddressForm"/>

</form-beans>
<action-mappings>

<action path="/Welcome"
forward="/pages/Welcome.jsp"/>


<action path="/LastTry"
type="finalpackage.FinalAction"
forward ="/pages/FinalJsp.jsp"/>

<action path="/Address"
type="finalpackage.AddressAction"
name="AddressForm"
scope="request"
validate="true"
input="/pages/Address.jsp">
<forward name= "success" path="/pages/success.jsp"/>
<forward name="CANCEL" path="/pages/Welcome.jsp"/>

</action>
</action-mappings>
Alaa Nassef
Ranch Hand

Joined: Jan 28, 2008
Posts: 460
Dear Harshani,

Struts 2 is a totally different framework. Even if you change the config file, it won't just work.


Visit my blog: http://jnassef.blogspot.com/
Harshani Wickramarathna
Greenhorn

Joined: Nov 15, 2007
Posts: 28
Hi..
Thank you very much for your reply..

I just tried to combine those struts1 and struts2. i think it is possible. is it?
I added struts2 JARS into my struts1 project,
change the web.xml and add:

<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>.

But action mappings in struts 2 are not working.
can you please help me??

thanks and best regards
Harshani
 
Don't get me started about those stupid light bulbs.
 
subject: how to modify struts-config.xml to migrate struts2?
 
Similar Threads
form bean
Problem with Validator Framework
Struts2 and Spring integration
Cannot retrieve mapping for action
Struts validation not working