Is there a way in JSP to tell if a page is a post back or not? for example if I have a form and it submits to itself. Is there a way in jsp to determine if its the first time the page has come up or if it is from pushing the submit button?
You could set a variable in the session and check to see if it exists, or you could set a hidden field in the form and then check it in the request obj.
the methods Phil mentions are excellent -- and probably the most popular. You can also use HttpServletRequest.getHeader() and get the referer -- that will tell you which page the user came from. You can see if they came from this same page.
Hi Mark u can try this as well, if u have a submit button with name say btnSubmit then at very bigning or ur jsp u can check if(request.getParameter("btnSubmit")==null) { this means submit button is not clicked and still ur here..!!! } regards Praful
All desirable things in life are either illegal, banned, expensive or married to someone else !!!
Are we home yet? Wait, did we forget the tiny ad?
a bit of art, as a gift, the permaculture playing cards