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

Calling Action on Pageload

 
Ankit Khandelwal
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All

I have a create page and i what i am trying to achieve is , when a user will submit the form , s/he will navigate to the next page where s/he can see the updated data as a List.

Using Struts 2 , Add jsp >> calling an action >> calling method save >> if result success >> navigate to another page >> View List

Where do i mention an action which will call ViewDetails method and on successful return of that method what would i mention in result tag .... i mean will i mention the same page >> ViewDetail.jsp


Please help.

 
Yogesh Lonkar
Ranch Hand
Posts: 94
Eclipse IDE Hibernate Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
AFTER the data is saved successfully you can specify in struts.xml to go other action if success like this

note that you need to populate saved data from resource in execute() or which ever method you want in YourDisplayAction class and then access that data in display.jsp
 
Ankit Khandelwal
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot Yogesh

I really like the way you answered my question, it shows that you have good hands on Struts 2

Please keep in touch because i am developing an application and i might face problems in future like this.


Thanks a lot once again for your help.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic