how to bring back form values if validation fails?

I am posting my standart jsp form to a servlet for validation...if validation fails request.getDispatcher runs and forward the page to the previous form page...

Now here is the problem;

When page forwarded to previous my form values are lost...and this is very user unfriendly...

how am i going to bring them back?

thank you

[355 byte] By [netsonicca] at [2007-11-26 15:04:21]
# 1

Dear Friend,

I have two Suggestions:

1: You u can't validate using JavaScript on the Client side ?

2: On the Page Dispatcher store all the values in sessions / cookiees.

One Condition: On the Previous page (user entry page) Fetch the values from Cookie / sessions and place them appropriately,

On the first time page load their will not be any values in the sessions / cookies Check if their were null then leave empty on these fields.

Did u got the answer ?

Regards,

Rengaraj.R

renga_muralia at 2007-7-8 8:54:01 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

yes its a way of doing that...but i asked if there is an easy way to do it like with a form option...still asking if any expert knows about it?

javascript will handle most of the error messages but server side must have the same options in a pro. application.

thanks anyway i will store them somewhere in hashmap or cookie...;)

netsonicca at 2007-7-8 8:54:01 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
I would leave such detail in the hands of a framework like struts / JSF.They handle validation / re-entry of values very well.
evnafetsa at 2007-7-8 8:54:01 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...