• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem when refresh the page in WebLogic 8.1 Struts

 
Bikash Paul
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
How can i do in jsp(actually this is on html) to be submitted only when i click the submit button?Right now, i already submitted the form and then press the refresh button of the browser it is submitted again. I am using WebLogic8.1 workshop and Struts Framework. How can i prevent this one?
Thanks
Bikash
 
Corneil du Plessis
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you press the refresh button it will refresh the current request. Your current page is a response from a 'post' of the previous page.
If you want the customer to be able to refresh the screen you must use redirect=true in you forward mapping in Struts. The response is then a result of a separate get operation. It also means that the form will have to be in session scope and not request scope.
If you want to prevent the customer from refreshing and thus re-submitting you should put a property in your form that indicates the state so the your validate can produce an error.
You must remember that if the form is submitted the Struts controller will assign the request parameters to your form and then call validate, it may overwrite something you want preserved.
 
Bikash Paul
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Actually I have tried with below code in .jpf file.


I am using weblogic8.1 workshop. I am not giving any mappings. That mapping will do automatically in workshop itself.

If any other solutions pls guide me.
Thanks
Bikash
[ March 02, 2004: Message edited by: Bikash Paul ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic