problem is the first time the page is loaded, there is an error in the request.getParameter() statement since no form has yet been submitted i guess ....
if i use another page ... it works ... but i want to display the information in the same page ...
Originally posted by yoga babu:
the value in the text field is disappering.how to keep this value as such even after submission of the data.
hope you will get your solution here.. you just need to do that to bind your string variable with value in textfield by checking null like what Bosun Bello did for you in above code..
your code would be like this..
hope this helps..
[ December 14, 2006: Message edited by: Saif uddin ]
Originally posted by Dhanya Palanisamy:
You can use this also
if (request.getParameter("Submit")!=null) so that your page does not show any error for the first time
Why you check the submit value ?
I think we don't need to check the Button value in this condition. The error will not occur on the submit(button) value because i retrieved textField value in request.getParameter("MyText") so i already applied that (if condition) in above post to checking the null value.. for the first time loading.
if (request.getParameter("Submit") != null) makes sure the page has already been submitted. So placing getParameter() for other fields inside this condition will not give you any errors before the page is submitted.
If you have one or two fields you can check for null values as you suggested but it will be difficult if you have more fields.
Hope i explained properly.
[ December 15, 2006: Message edited by: Bear Bibeault ]