pro_jsp thread: The problem is with the Registration Example from chapter 4, JSP and JavaBeans
The problem is with the Registration Example from chapter 4, JSP and JavaBeans. After filling in and
submitting the form produced by logonRegister.jsp, I get a long error message.
Error Message:
Error: 500
Internal Servlet Error:
org.apache.jasper.JasperException: Unable to compile class for
JSPwork\8080%2Fexamples\_0005cjsp_0005cch_00030_00034_0005cregistered_0002ejspregistered_jsp_0.java:94: Invalid escape character.
JspRuntimeLibrary.introspecthelper(pageContext.findAttribute("app"), "sqlString","INSERT INTO Registration \( FName,
LName, Title, EMail, PhoneNo, JobTitle \) values \(\?,\?,\?,\?,\?,\?\)",null,null, false);
^
work\8080%2Fexamples\_0005cjsp_0005cch_00030_00034_0005cregistered_0002ejspregistered_jsp_0.java:94: Invalid escape character.
JspRuntimeLibrary.introspecthelper(pageContext.findAttribute("app"), "sqlString","INSERT INTO Registration \( FName,
LName, Title, EMail, PhoneNo, JobTitle \) values \(\?,\?,\?,\?,\?,\?\)",null,null, false);
^
work\8080%2Fexamples\_0005cjsp_0005cch_00030_00034_0005cregistered_0002ejspregistered_jsp_0.java:94: Invalid escape character.
JspRuntimeLibrary.introspecthelper(pageContext.findAttribute("app"), "sqlString","INSERT INTO Registration \( FName,
LName, Title, EMail, PhoneNo, JobTitle \) values \(\?,\?,\?,\?,\?,\?\)",null,null, false);
^
work\8080%2Fexamples\_0005cjsp_0005cch_00030_00034_0005cregistered_0002ejspregistered_jsp_0.java:94: Invalid escape character.
JspRuntimeLibrary.introspecthelper(pageContext.findAttribute("app"), "sqlString","INSERT INTO Registration \( FName,
LName, Title, EMail, PhoneNo, JobTitle \) values \(\?,\?,\?,\?,\?,\?\)",null,null, false);
^
work\8080%2Fexamples\_0005cjsp_0005cch_00030_00034_0005cregistered_0002ejspregistered_jsp_0.java:94: Invalid escape character.
JspRuntimeLibrary.introspecthelper(pageContext.findAttribute("app"), "sqlString","INSERT INTO Registration \( FName,
LName, Title, EMail, PhoneNo, JobTitle \) values \(\?,\?,\?,\?,\?,\?\)",null,null, false);
^
work\8080%2Fexamples\_0005cjsp_0005cch_00030_00034_0005cregistered_0002ejspregistered_jsp_0.java:94: Invalid escape character.
JspRuntimeLibrary.introspecthelper(pageContext.findAttribute("app"), "sqlString","INSERT INTO Registration \( FName,
LName, Title, EMail, PhoneNo, JobTitle \) values \(\?,\?,\?,\?,\?,\?\)",null,null, false);
^
work\8080%2Fexamples\_0005cjsp_0005cch_00030_00034_0005cregistered_0002ejspregistered_jsp_0.java:94: Invalid escape character.
JspRuntimeLibrary.introspecthelper(pageContext.findAttribute("app"), "sqlString","INSERT INTO Registration \( FName,
LName, Title, EMail, PhoneNo, JobTitle \) values \(\?,\?,\?,\?,\?,\?\)",null,null, false);
^
work\8080%2Fexamples\_0005cjsp_0005cch_00030_00034_0005cregistered_0002ejspregistered_jsp_0.java:94: Invalid escape character.
JspRuntimeLibrary.introspecthelper(pageContext.findAttribute("app"), "sqlString","INSERT INTO Registration \( FName,
LName, Title, EMail, PhoneNo, JobTitle \) values \(\?,\?,\?,\?,\?,\?\)",null,null, false);
^
work\8080%2Fexamples\_0005cjsp_0005cch_00030_00034_0005cregistered_0002ejspregistered_jsp_0.java:94: Invalid escape character.
JspRuntimeLibrary.introspecthelper(pageContext.findAttribute("app"), "sqlString","INSERT INTO Registration \( FName,
LName, Title, EMail, PhoneNo, JobTitle \) values \(\?,\?,\?,\?,\?,\?\)",null,null, false);
^
work\8080%2Fexamples\_0005cjsp_0005cch_00030_00034_0005cregistered_0002ejspregistered_jsp_0.java:94: Invalid escape character.
JspRuntimeLibrary.introspecthelper(pageContext.findAttribute("app"), "sqlString","INSERT INTO Registration \( FName,
LName, Title, EMail, PhoneNo, JobTitle \) values \(\?,\?,\?,\?,\?,\?\)",null,null, false);
^
10 errors
at org.apache.jasper.compiler.Compiler.compile(Compiled Code)
at org.apache.jasper.runtime.JspLoader.loadJSP(JspLoader.java:226)
at org.apache.jasper.runtime.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:137)
at org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:148)
at org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:247)
at org.apache.jasper.runtime.JspServlet.service(Compiled Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
at org.apache.tomcat.core.ServiceInvocationHandler.method(ServletWrapper.java:626)
at org.apache.tomcat.core.ServletWrapper.handleInvocation(Compiled Code)
at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:378)
at org.apache.tomcat.core.Context.handleRequest(Context.java:644)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:440)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:144)
at org.apache.tomcat.service.TcpConnectionThread.run(TcpEndpoint.java:304)
at java.lang.Thread.run(Thread.java:479)
The problem seems to be that the escape character(\) is unnecessarily (and arbitrarily, it seems) inserted into the SQL Query.
I have been unable to figure out why the escape character is being inserted. I hope you will promptly reply with a solution to my problem.