Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

get the value from HTML form into servlet  RSS feed

 
Aya Muhannad
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

in servlet

The problem is the the request did not give any value then the a variable all is null
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For starters, strings are compared using the "equals" method, not using the "==" and "!=" operators. So ' request.getParameter("all")!="" ' is wrong.

The form field "all" is incomplete - it is missing the "value" field. Does it work if you fix that, and leave out all the JavaScript code? If so, then the second step is to figure out why the JavaScript code doesn't work as intended.
 
James Harte
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aya -

A couple points:
1) Always line up your code, it makes it alot easier for people to look at the code to help you.
2) You have an error in your code on the input type="submit" line.
3) Try using equals() for string comparison
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!