how can I fix this error?
index.html code is
<html>
<head>
<title> weblogic 7 bibleapp </title>
<meta http-equiv="Content-Type" content="text/html">
</head>
<body>
welcome to BibleAPP
<form action="http://localhost:7001/BibleApp/Hello">
<br> Name: <input type="text" name="stdname" value="pinky" >
<input type="submit" >
</form>
</body>
</html>
my
servlet code is :
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
public class HelloServlet extends HttpServlet
{
public void doGet(HttpServletRequest req,HttpServletResponse resp) throws ServletException,IOException
{
resp.setContentType("text/html");
PrintWriter out = resp.getWriter();
String param = req.getParameter("stdname");
if(param == null )
{
out.println("<html>"+"<body>" + "no parameter"+"</body>" +"</html>");
}
else
out.println(
"<html>"+"<body>"+
"my name is"+ param +"</body>"+
"</html>"
);
}
}
my web.xml code is:
<?xml version="1.0" ?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name> servlet12 </servlet-name>
<servlet-class> servlet1 </servlet-class>
</servlet>
<servlet-mapping>
<servlet-name> servlet12 </servlet-name>
<url-pattern> /ser </url-pattern>
</servlet-mapping>
<servlet>
<servlet-name> Servlet2 </servlet-name>
<servlet-class>HelloServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name> Servlet2 </servlet-name>
<url-pattern> /Hello </url-pattern>
</servlet-mapping>
</web-app>
I deploy this application is in weblogic 8 platform.
when I click on submit button I got an error messaage:
Error 500--Internal Server Error
java.lang.NoClassDefFoundError: java/lang/StringBuilder
at HelloServlet.doGet(HelloServlet.java:18)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1006)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6718)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3764)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2644)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)my
why do I get this error message?How can I fix it?