• 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

input box for variable x is null in jsp but in servlet the method x.length() returns 10

 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

i have the following jsp as my log in page:



The following code is my servlet:



However even when the username and password is null in the log in page the logger for passwrd.length() and name.length() is int 10.
When i run name.trim().length() it returns int 0.

How is it initialising a null input box?
Any suggestion please?

Thanks in advance.
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't understand. The HTML you posted there is going to be displayed to the user, and they are going to fill in the fields and press the Submit button, right? And then that's going to submit the fields to the servlet code you posted, right?

And you described the HTML you posted as a JSP. So your JSP generates the HTML and sends it to the browser, where the user will then fill in the fields. So I don't see why you would expect the JSP to contain that data, when the user hasn't even typed it yet.
 
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what this logger.info() does..?
 
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

prashant chindhade wrote:what this logger.info() does..?


Log4J
 
reply
    Bookmark Topic Watch Topic
  • New Topic