Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

For a single submission on a jsp , two instances are generated in baseaction class

 
Lakshmi friend
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When i click once on a button called save , the process done in the flow from baseAction till the DAO, it is all twice. i.e if i have something like a system.out.println("hello") in the DAO with no loop. Hello is getting printed twice in my console , also we checked it with a static count variable as and when the control enters the action class. The count value is 2 for a single submission.
But this functionality works fine on my colleagues machine. everything being same configuration .Unable to understand as to what the problem might be.
Any Help will be appreciated on this.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check to see if you have a submit button that also has an onclick event. That can cause this type of behavior. Example:

If you want to submit using JavaScript, use an html:button tag instead.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic