• 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

Getting null value in the form of jsp for submit button

 
Greenhorn
Posts: 12
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...



 
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
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
    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
    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
      Number of slices to send:
      Optional 'thank-you' note:
    • 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
    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
    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
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    can you tell me the solution..How to get the submit value without null?
     
    Bear Bibeault
    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
    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
    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
    [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.
     
    When you have exhausted all possibilities, remember this: you haven't - Edison. Tiny ad:
    a bit of art, as a gift, the permaculture playing cards
    https://gardener-gift.com
    reply
      Bookmark Topic Watch Topic
    • New Topic