• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Getting null value in the form of jsp for submit button

 
Greenhorn
Posts: 12
Hibernate Eclipse IDE 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...



 
Marshal
Posts: 67418
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • 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
    Marshal
    Posts: 67418
    173
    Mac Mac OS X IntelliJ IDE jQuery Java
    • 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
    Hibernate Eclipse IDE 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
    Marshal
    Posts: 67418
    173
    Mac Mac OS X IntelliJ IDE jQuery Java
    • 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
    Hibernate Eclipse IDE 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
    Marshal
    Posts: 67418
    173
    Mac Mac OS X IntelliJ IDE jQuery Java
    • 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
    Marshal
    Posts: 67418
    173
    Mac Mac OS X IntelliJ IDE jQuery Java
    • 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.
     
    Don't get me started about those stupid light bulbs.
      Bookmark Topic Watch Topic
    • New Topic