tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Smith <>
Subject Re: how to keep form data
Date Thu, 25 Oct 2001 15:59:12 GMT
I would like to add to that.   It's a better user experience to do the 
validation on the client side since they don't have to actually submit and 
then wait for a reply, but definitely still validate on the server side as 
well.  All data coming into a web server should be considered untrusted until 
proven otherwise.  After all, the submission might come from one of your 
pages or some hacker trying to break/exploit your app.

As far as keeping form data, I tend to have the form submit data to the page 
it's in and then do some code to grab the data and process it.  Then forward 
the user to the next page.  Obviously do a quick check and if there is no 
form data skip the processing.  If there's a problem, then just take the 
submitted form data and enter it back in the form with value="<%= ... %>" 

--David Smith

On Wednesday 24 October 2001 08:05 pm, you wrote:
> If you do the validation in the client side (using java script) you do not
> lose the information. Besides this is a better approach once you don't want
> your code to do the avalidation in the server side and then post that the
> user made a mistake.
> Keep validation in the client side always
> Siomara pantarotto
> From: Henry <>
> >Reply-To:
> >To: <>
> >Subject: how to keep form data
> >Date: Wed, 24 Oct 2001 09:19:47 -0600 (Mountain Daylight Time)
> >
> >when a user submits a form, the content is checked and
> >if anything is invalid, the user is prompted to
> >correct and submit the form again.
> >
> >how can i keep the content the user typed in before?
> >
> >I am using RequestDispatcher.forward("originalform.html");
> >
> >is there a flag or something to set?
> _________________________________________________________________
> Get your FREE download of MSN Explorer at

View raw message