Forums Register Login

why is this so in jsp?

+Pie Number of slices to send: Send
Blanki have a problem in JSP.
my html page is as follows :
******** index1.html
<html><body>
<form action="http://127.0.0.1:8080/examples/jsp/demo/name.jsp"
method="post" >
<input type=text name=t1>
<input type=submit>
</form>
</body></html>
**********************
My jsp page is as follows :
******** name.jsp
<html><body>
Your Name is <%= request.getParameter("t1")
System.out.println("Hello");
%>
</body></html>

**********************
Its a simple and straight forward code but i am getting error as
************** Error :
Error: 500
Location: /examples/jsp/demo/name.jsp
Internal Servlet Error:
javax.servlet.ServletException: sun/tools/javac/Main
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java, Compiled
Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
at org.apache.tomcat.core.Handler.service(Handler.java:286)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
7)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:210)
at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java,
Compiled Code)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java,
Compiled Code)
at java.lang.Thread.run(Thread.java:479)
Root cause:
java.lang.NoClassDefFoundError: sun/tools/javac/Main
at
org.apache.jasper.compiler.SunJavaCompiler.compile(SunJavaCompiler.java:128)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java, Compiled
Code)
at org.apache.jasper.servlet.JspServlet.doLoadJSP(JspServlet.java:462)
at
org.apache.jasper.servlet.JasperLoader12.loadJSP(JasperLoader12.java:146)
at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:433)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspSe
rvlet.java:152)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
va:164)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java, Compiled
Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
at org.apache.tomcat.core.Handler.service(Handler.java:286)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
7)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:210)
at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java,
Compiled Code)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java,
Compiled Code)
at java.lang.Thread.run(Thread.java:479)
*********************

i am using TOMCAT Version 3.2.1
i am very new to jsp and not getting out of the blues.
can anybody help me ?

thank you in advance.
sachin
+Pie Number of slices to send: Send
The error that you get says that tomcat doesn't found the classes that you use!
Your classes must be in the folder web-inf/classes with the directory-hierarchy of your packages if you have.
In Js Pages you must import the packages/classes that you need!
$Regards
+Pie Number of slices to send: Send
Also I think you've missed a few closing statments ... you JSP should look like this.
<html><body>
Your Name is <%= request.getParameter("t1") %>
<%
System.out.println("Hello");
%>
</body></html>
I'm assuming you want "hello" to be printed to the console / log rather than to the page!
If you want Hello to be printed to the page ... then your JSp should look like this.
<html><body>
Your Name is <%= request.getParameter("t1")%>
Hello
</body></html>
[This message has been edited by Angela Poynton (edited March 20, 2001).]
+Pie Number of slices to send: Send
Root cause:java.lang.NoClassDefFoundError: sun/tools/javac/Main
It is looking for the Java compiler to compile the JSP - you need to have tools.jar in the classpath somewhere.
<input type=text name=t1>
For compatibility with all browsers and the HTML spec, you should be enclosing those strings in quotes. ie:
<input type="text" name="t1">
Bill

------------------
author of:
+Pie Number of slices to send: Send
 

Originally posted by Angela Poynton:
Also I think you've missed a few closing statments ... you JSP should look like this.
<html><body>
Your Name is <%= request.getParameter("t1") %>
<%
System.out.println("Hello");
%>
</body></html>
I'm assuming you want "hello" to be printed to the console / log rather than to the page!
If you want Hello to be printed to the page ... then your JSp should look like this.
<html><body>
Your Name is <%= request.getParameter("t1")%>
Hello
</body></html>
[This message has been edited by Angela Poynton (edited March 20, 2001).]



Dear sir,
thanks for your reply.
i got the way out of it using your code.
thanks for your guidence
sachin
+Pie Number of slices to send: Send
You're welcome .. always glad to help .. and BTW I'm a girl so Dear Miss would have be a better salutation ... I'll put it down to a simple mistake and take my praise.
Morning came much too soon and it brought along a friend named Margarita Hangover, and a tiny ad.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 955 times.
Similar Threads
Cast object[][] into strings
jsp examples
error 500
error 500
struts problem
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 08:57:20.