Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Harshani Wickramarathna
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 471
Hibernate Mac OS X Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Harshani,

Struts 2 is a totally different framework. Even if you change the config file, it won't just work.
 
Harshani Wickramarathna
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic