• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Migrating from Struts 1.1 to 1.2.4

 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I had developed web application using struts 1.1, but want it to migrate it to 1.2.4. Has anybody done this..what are the risks?

Regards,
Satish
 
Ranch Hand
Posts: 354
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i did this for several of our applications a while ago...all went smoothly. it took me 1/2 day for the first app and 1/2 hour each for the next 4 (mid-size apps). the risks depend on what features of 1.1 you've used, especially with validation and messaging. the whole ActionErrors and related classes deprecation can be pains in the ass. here are some points to remember (i'll send you a bill later), especially if you want to get rid of deprecations:

1. validation.xml needs doc-type declaration
2. validation-rules.xml - replace all ActionErrors with ActionMessages
3. do the same for all your action classes
4. if you have custom validations, replace Resources.getActionError() with Resources.getActionMessage()
5. v1.1 ValidatorUtil. methods must be replaced by org.apache.commons.validator.util.ValidatorUtils

you need to also be conscious of where you have stored your errors and messages. the contants are now in the Globals class.

if you use JSTL to display struts errors, you'll need to do step 2 above.
 
Satish Kulkarni
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Alan,
Thanks for the response. I am not using Validator..but I will have to change the ActionError to ActionMessage though. I had another question on the controller interface. It currently has two methods "execute" and "perform", but the "perform" is deprecated. So if I am extending Controller class i need to implement both the methods...

Regards,
Satish
 
alan do
Ranch Hand
Posts: 354
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ohhhh...that sucks. the way around it is to have a CustomController which implements the perform() and execute() of the Controller interface and do nothing. all the rest of the Controllers then would extend this CustomController and override ONLY the execute() method. this fits the rule of java interface inheritance right? anyone? or is the subclasses of the parent class that implements the interface also need to implement all the methods? i am too lazy to do a quick test.
reply
    Bookmark Topic Watch Topic
  • New Topic