• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP page getting executed twice

 
juanschodiger jha
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I used 4 jsp pages in my application.When users selects some item on jsppage3 and clicks on go button then request will be redirected to jsppage4 but
everything on jsppage4 is getting executed twice.

Can you please let me know the reason why it is getting executed twice.I have all research on this topic still unanswered.

 
Neeraj Dhiman
Ranch Hand
Posts: 68
IBM DB2 Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
we can not say anything without seeing your jsp code.
 
Vicky Vijay
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
juanschodiger jha wrote:
I used 4 jsp pages in my application.When users selects some item on jsppage3 and clicks on go button then request will be redirected to jsppage4 but
everything on jsppage4 is getting executed twice.

Can you please let me know the reason why it is getting executed twice.I have all research on this topic still unanswered.



Check whether the form submission from .."jsppage3" happens twice ??!!

For Quicker response, Please post your code
 
Stefan Evans
Bartender
Posts: 1692
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
at a guess, it seems you have an <input type="submit"> which will submit the form when you click it.
You probably also have a javascript onclick event which will call form.submit().

Thus your form gets submitted (and thus processed) twice.

Standard resolutions
- in the onclick handler return false to indiciate you have handled the event
or
- make it a button type different from input type="submit"
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic