Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

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

 
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>
 
Ranch Hand
Posts: 471
Mac OS X Hibernate 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
 
Yeah, but is it art? What do you think tiny ad?
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic