aspose file tools
The moose likes JSP and the fly likes checking request.getparamter null value in if black Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "checking request.getparamter null value in if black" Watch "checking request.getparamter null value in if black" New topic
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
     
    Threads others viewed
    JSP with multipart form
    request.getParameter() from same page as HTML FORM
    JSP not posting variables
    image button value not present in servlet
    Another simple question
    WebSphere development made easy
    without the weight of IBM tools
    http://www.myeclipseide.com