• 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
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

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
Hello,
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 ...
PROBLEM :
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 ???
 
Greenhorn
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>
</result>
You can find the doc here

http://struts.apache.org/2.x/docs/chain-result.html
 
reply
    Bookmark Topic Watch Topic
  • New Topic