Piyush Mangal wrote:Why are using scriplet on JSP page. You should be using EL and JSTL tag on JSP page.
Please use ${NUM} instead of NUM in your href element.
Piyush Mangal wrote:I don't understand what is not working. What is the result when you use ${NUM}?
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
java.lang.NumberFormatException: null
java.lang.Integer.parseInt(Unknown Source)
java.lang.Integer.parseInt(Unknown Source)
SerRec.doPost(SerRec.java:28)
SerRec.doGet(SerRec.java:20)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:402)
org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:134)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
InfonetFilter.doFilter(InfonetFilter.java:43)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.18 logs.
Apache Tomcat/6.0.18
Piyush Mangal wrote:Use "../servlet/SerRec?cno=${NUM}" in your href.
Piyush Mangal wrote:Seems like EL is not enabled on your jsp. Search the forum and you will find lot of posts regarding the same.
Although It is not a good pratice to use scriplet but you can try with "../servlet/SerRec?cno=<%= request.getAttribute("NAME") %>" in your href.
select M_CNO,M_NAME,M_RELATION, from M_BENEFIT where M_EMPL_NO="+M_EMPL_NO;
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
java.lang.NumberFormatException: For input string: "abc"
java.lang.NumberFormatException.forInputString(Unknown Source)
java.lang.Integer.parseInt(Unknown Source)
java.lang.Integer.parseInt(Unknown Source)
SerRec.doPost(SerRec.java:28)
SerRec.doGet(SerRec.java:20)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:402)
org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:134)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
InfonetFilter.doFilter(InfonetFilter.java:43)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.18 logs.
Apache Tomcat/6.0.18
java.lang.NumberFormatException: For input string: "abc"
java.lang.NumberFormatException.forInputString(Unknown Source)
java.lang.Integer.parseInt(Unknown Source)
java.lang.Integer.parseInt(Unknown Source)
Piyush Mangal wrote:
java.lang.NumberFormatException: For input string: "abc"
java.lang.NumberFormatException.forInputString(Unknown Source)
java.lang.Integer.parseInt(Unknown Source)
java.lang.Integer.parseInt(Unknown Source)
String cn = request.getParameter("cno") is returning abc which is not an Integer value so when you are trying to parse "abc" to an Integer, you are receiving NumberFormatException.
Please update your db record with proper integer value if it is supposed to be an Integer.
An Error Had occurred while accessing the database
--------------------------------------------------------------------------------
ORA-00904: "M_EMPL_NO": invalid identifier
Megha Singhal wrote:
Piyush Mangal wrote:
java.lang.NumberFormatException: For input string: "abc"
java.lang.NumberFormatException.forInputString(Unknown Source)
java.lang.Integer.parseInt(Unknown Source)
java.lang.Integer.parseInt(Unknown Source)
String cn = request.getParameter("cno") is returning abc which is not an Integer value so when you are trying to parse "abc" to an Integer, you are receiving NumberFormatException.
Please update your db record with proper integer value if it is supposed to be an Integer.
now this is giving following error
An Error Had occurred while accessing the database
--------------------------------------------------------------------------------
ORA-00904: "M_EMPL_NO": invalid identifier
Consider Paul's rocket mass heater. |