| Author |
checking request.getparamter null value in if black
|
subbu kanna
Greenhorn
Joined: Jan 11, 2012
Posts: 4
|
|
Hello Rancehers,
I am doing jsp registration form , in that form I have many fields like, fanme, lname, city, state, when I submit the jsp page with HTTP post method
and the saveregister.jps page I check like the request parameter
I know javascript we can validate the jsp page and then we can allow to post the page. But I wanted to know, if I submit the page, whether any way we can check the request.getparameter('field')==null
if(request.getparameter("city")==null)
out.println("city is not filled");
Please give me some suggestions
regards
|
 |
Bear Bibeault
Author and opinionated walrus
Marshal
Joined: Jan 10, 2002
Posts: 50691
|
|
Two things:
You should not be processing the form in a JSP. SUbmit the form to a servlet. Modern JSP should have no Java code within it and should be used only to create views.Regardless of whether you perform validation on the client with JavaScript, your server code must also perform validation. The client-side validation can easily be circumvented.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
 |
|
|
subject: checking request.getparamter null value in if black
|
|
|