Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Multiple calls to struts2 action

 
kooper Sivan
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi,

My project uses struts2 with spring and Jpa on Hibernate.
On debugging the application i've seen that the action class is being invoked twice.
Am unable to figure out why this occurs.
Is it something to do with the transaction?
Any suggestions on why this is happening.

Thanks,
Kooper
 
Mohana Rao Sv
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
whatever the frameworks you integrate with struts 2 action class never execute twice until and unless you redirect to the same action again.
 
kooper Sivan
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mohan,

Thanks for your reply.
Could you please elaborate more on this.
I was unable to understand what exactly you meant by redirecting to the same action class..

Thanks,
Kooper
 
kooper Sivan
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And how do i prevent redirection to the same action class..
 
Mohana Rao Sv
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
post your struts.xml configuration file. For your reference follow the link http://struts.apache.org/2.0.11/docs/redirect-action-result.html
 
kooper Sivan
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

sure please find below


the above action is invoked when a link is clicked for the first time to load the page "manageUsers.jsp" with values from DB.
the action which returns JSON has been commented for the timebeing.



the above method is invoked by the action, the subsequent methods within populate data at runtime, but the the method is getting invoked twice, even after the processing is over the first time.



 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic