I have an intranet website that has a lot of display/edit/delete
functionality using forms.

For example - to create a new customer the user would open
customerMaint.jsp, enter the details and click submit.

Clicking submit calls a servlet (lets call it SaveServlet) that saves the
details. This servlet then forwards to customerMaint.jsp to display the
saved details.

Unfortunately (for me anyway), after the forward, the URL in the browser is
still SaveServlet. Consequently, if the user refreshes the browser (hits F5
in IE), the form is resubmitted and hey presto we now have 2 customers with
the same details.

I'm sure I'm not the only person to have this problem. How are others
handling this situation?

ie open page -> submit form -> forward to initial page with saved details ->
stop the user from resubmitting the original form.

I have played around with sendredirect but there are quite a few limitations
I cant get around - namely

1. its slower than doing a forward
2. the request parameters arent automatically passed to the sendRedirected
page. You have to do it manually.
3. if you have a very large parameter there is no nice way to send to to the
sendRedirected page (eg like a POST). For example we save details by
building up an xml string and sending it as a form parameter. This string
can get very long and cant really be tacked on to the end of the query
string in the url when sendRedirect is called.

Anyone have any bright ideas? Any help appreciated.

Thanks
Matt


Reply via email to