• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

checking request.getparamter null value in if black

 
Greenhorn
Posts: 4
Netbeans IDE Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
  •  
    reply
      Bookmark Topic Watch Topic
    • New Topic