• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting null value in the form of jsp for submit button

 
Ishitha Dyanil
Greenhorn
Posts: 12
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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
Pie
Posts: 65229
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

  •  
    Bear Bibeault
    Author and ninkuma
    Marshal
    Pie
    Posts: 65229
    95
    IntelliJ IDE Java jQuery Mac Mac OS X
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
    Posts: 12
    Eclipse IDE Hibernate Java
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
    Pie
    Posts: 65229
    95
    IntelliJ IDE Java jQuery Mac Mac OS X
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
    Posts: 12
    Eclipse IDE Hibernate Java
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    can you tell me the solution..How to get the submit value without null?
     
    Bear Bibeault
    Author and ninkuma
    Marshal
    Pie
    Posts: 65229
    95
    IntelliJ IDE Java jQuery Mac Mac OS X
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
    Pie
    Posts: 65229
    95
    IntelliJ IDE Java jQuery Mac Mac OS X
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    [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.
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic