• Post Reply Bookmark Topic Watch Topic
  • New Topic

jsp to store into access  RSS feed

 
Sandeep Mali
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, i have written this jsp code(welcome1.jsp) to retrieve details from a html file(regpage.html) and store them in an access file(Table.mdb)
welcome1.jsp


regpage.html

Im unable to store the datails in Access DB and upon altering the jsp code I get the following errors,
java.lang.NullPointerExceptionorg.apache.jsp.project.welcome1_jsp._jspService(org.apache.jsp.project.welcome1_jsp:68

What is the possible mistake that Im commiting?

Thanks in advance,
Sandeep.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should insert a couple of debugging printouts to confirm which of your statements is causing the Exception (could be that you don't get a database connection). Before you start writing to a DB, make sure that you can read from it.

As a side not, it is considered bad practice to put DB code in JSP pages. Much better to put it in a bean, if you don't want to route the request through a servlet.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Under TOMCAT/work/Catalina/localhost/org/apache/jsp/project, you will find the generated servlet code for your JSP. Look on line 68 to see what varible is causing your NullPointerException (NPE).
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!