• Post Reply Bookmark Topic Watch Topic
  • New Topic

checking request.getparamter null value in if black

 
subbu kanna
Greenhorn
Posts: 4
Eclipse IDE Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
  •  
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!