File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Getting null value in the form of jsp for submit button Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Getting null value in the form of jsp for submit button" Watch "Getting null value in the form of jsp for submit button" New topic
Author

Getting null value in the form of jsp for submit button

Ishitha Dyanil
Greenhorn

Joined: Jan 18, 2012
Posts: 12



Hi,

I'm new to jsp and java world,
here I'm trying to use some form and getting those parameters and I'm using simple logic that if the submit values are null send that to again same page rytelse
printing the values.
But the problem is getting evey time submit value null.
tried with hidden value but not worked for the logic.

So can anyone help me please,how to get the values of type=submit...



Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61766
    
  67

As a novice to JSP you should not be putting Java code into your pages. That's a poor practice that has been discredited for 10 years now. Your page is written as if it were code in 2001!

Find an updated reference that emphasizes the use of JSTL and EL over Java Scriptlets.

I also recommend that newcomers to JSP read the following articles:
  • The Secret Life of JSPs
  • The Front Man


  • [Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
    Bear Bibeault
    Author and ninkuma
    Marshal

    Joined: Jan 10, 2002
    Posts: 61766
        
      67

    P.S. Carefully inspect your code of line 45.

    P.P.S. Using all uppercase for HTML is another old-fashioned practice that you should ditch. Use lowercase.
    Ishitha Dyanil
    Greenhorn

    Joined: Jan 18, 2012
    Posts: 12

    I tried to put all lower case letters but still same problem,
    submit is giving null value.
    Can any one solve my problem so that i can go forward.

    Bear Bibeault
    Author and ninkuma
    Marshal

    Joined: Jan 10, 2002
    Posts: 61766
        
      67

    I didn't say the using lowercase would solve your problem, just that it would help to make your code more readable.
    Ishitha Dyanil
    Greenhorn

    Joined: Jan 18, 2012
    Posts: 12

    can you tell me the solution..How to get the submit value without null?
    Bear Bibeault
    Author and ninkuma
    Marshal

    Joined: Jan 10, 2002
    Posts: 61766
        
      67

    You haven't done a very good job of describing the problem. Are you saying that you are getting nulls for form values when trying to read them from the servlet that form is being submitted to?

    If so, you'll need to show us the servlet code.
    Bear Bibeault
    Author and ninkuma
    Marshal

    Joined: Jan 10, 2002
    Posts: 61766
        
      67

    [Added] It looks like you are submitting the form to a JSP. Not a good idea. JSPs are for views not processing. You should be submitting the form to a servlet.
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: Getting null value in the form of jsp for submit button