• 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 ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

struts 2 and messages !!

Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have two methods in my action that are save and list and two jsps respectively . when user add new record it goes to save method where i am using addActionMessage("record added successfully") and goes to list method
to populate all record list and and show on list jsp ...
1- if i use type="redirect" attribute in action in struts.xml ,
<result name="success" type="redirect">listRecord.htm</result>
i think it generates new request because of which it is not showing message set in addActionMessage method , when it goes to list jsp through the list method..
2- when i change the result type to type="chain"
<result name="success" type="chain">listRecord</result>
it shows the message on list jsp but another problem occured ....since it does not nullify the request in this case , the action set in request which is like this "action:save" creates problem. when i click sortable option of display tag , rather than going to list method it goes to the save method , thus throwing exception (in my case) because of duplicate record ...
....................... any solution ???
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I believe what you are looking for is this
<result type="chain">
<param name="actionName">login_*</param>
<param name="method">input</param>
You can find the doc here

money grubbing section goes here:
a bit of art, as a gift, that will fit in a stocking
    Bookmark Topic Watch Topic
  • New Topic