• Post Reply Bookmark Topic Watch Topic
  • New Topic

Servlet Controller cannot access my jsp request values

 
Arunkumar Chinnadurai
Ranch Hand
Posts: 56
Android MyEclipse IDE Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,


this is my jsp code



this is my servlet code :



I`m getting folowing error . please help me out from this.

Admin User ID : null Password : null
The String is : null
java.lang.NullPointerException
at com.tekno.utility.LoginUtility.checkSplCharSet_Text(LoginUtility.java:158)
at com.tekno.controller.AdminLoginController.doPost(AdminLoginController.java:40)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)
java.lang.NullPointerException
at com.tekno.utility.LoginUtility.checkSplCharSet_Password(LoginUtility.java:177)
at com.tekno.controller.AdminLoginController.doPost(AdminLoginController.java:40)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)
From Has Record : select * from login where empid='null' and password=md5('null')


 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's the important part of the error message:

java.lang.NullPointerException
at com.tekno.utility.LoginUtility.checkSplCharSet_Text(LoginUtility.java:158)
at com.tekno.controller.AdminLoginController.doPost(AdminLoginController.java:40)


It tells you exactly where the problem lies.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


because this returns null. Use *name attribute of input tag* to get value on servlet.
replace id with name
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am too slow
 
Arunkumar Chinnadurai
Ranch Hand
Posts: 56
Android MyEclipse IDE Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I`m getting the out put .

i give control id in jsp pages, but in servlet controller i`m getting via name no i have changed the control properties are name..


thanks


 
Arunkumar Chinnadurai
Ranch Hand
Posts: 56
Android MyEclipse IDE Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks to Seetharaman Venkatasamy
 
Rob Spoor
Sheriff
Posts: 20820
68
Chrome Eclipse IDE Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seetharaman Venkatasamy wrote:replace id with name

I would actually not replace the name attribute, but add the id attribute with the same value. The name attribute is mostly used for submitting forms whereas the id attribute has several client side purposes (mostly for CSS and JavaScript).
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Arunkumar Chinnadurai wrote:Thanks to Seetharaman Venkatasamy

You are welcome
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!