HTTP Status 500 - Error instantiating servlet class RequestInfo,这是怎么回事

问题描述

我的RequestInfo.java内容为importjava.io.*;importjavax.servlet.*;importjavax.servlet.http.*;publicclassRequestInfoextendsHttpServlet{publicvoiddoGet(HttpServletRequestrequest,HttpServletResponseresponse)throwsIOException,ServletException{response.setContentType("text/html");//先设置Header,在这里只设置ContentType一项PrintWriterout=response.getWriter();//得到文本输出Writer//下面打印相关的HTMLout.println("<html>");out.println("<head>");out.println("<title>RequestInformationExample</title>");out.println("</head>");out.println("<body>");out.println("<h3>RequestInformationExample</h3>");out.println("RequestURI:"+request.getRequestURI()+"<br>");//打印请求的路径out.println("Protocol:"+request.getProtocol()+"<br>");//打印协议名称out.println("PathInfo:"+request.getPathInfo()+"<br>");//打印额外的路径信息out.println("RemoteAddress:"+request.getRemoteAddr());//打印客户机的地址,如果没有打印IP地址out.println("</body>");out.println("</html>");out.close();//关闭Writer}publicvoiddoPost(HttpServletRequestrequest,HttpServletResponseresponse)throwsIOException,ServletException{//如果是POST请求类型,同样调用GET类型的响应函数doGet(request,response);}}web.xml中servlet的配置为<servlet><servlet-name>RequestInfo</servlet-name><servlet-class>RequestInfo</servlet-class></servlet><servlet-mapping><servlet-name>RequestInfo</servlet-name><url-pattern>/RequestInfo</url-pattern></servlet-mapping>RequstInfo.class也放在了webapps/myapp/WEB-INF/classes目录内了

解决方案

解决方案二:
<servlet-class>RequestInfo</servlet-class>package要加上

时间: 2024-10-28 07:15:47

HTTP Status 500 - Error instantiating servlet class RequestInfo,这是怎么回事的相关文章

servlet-HTTP Status 500 - Servlet.init()

问题描述 HTTP Status 500 - Servlet.init() HTTP Status 500 - Servlet.init() for servlet springmvc threw exception type Exception report message Servlet.init() for servlet springmvc threw exception description The server encountered an internal error that

Tomcat报错:HTTP Status 500 (Wrapper cannot find servlet class)解决办法_java

Tomcat报错:HTTP Status 500 - Wrapper cannot find servlet class HTTP Status 500 - Wrapper cannot find servlet class com.servlet.servlet.RegServlet or a class it depends on type Exception report message Wrapper cannot find servlet class com.servlet.servl

jsp web html-HTTP Status 500 - javax.servlet.ServletException

问题描述 HTTP Status 500 - javax.servlet.ServletException type Exception report message javax.servlet.ServletException: java.lang.NoClassDefFoundError: org/apache/lucene/search/Query description The server encountered an internal error that prevented it

status-系统网页出现这报错:HTTP Status 500,是访问JSP页面哪个地方出错了或者别的?

问题描述 系统网页出现这报错:HTTP Status 500,是访问JSP页面哪个地方出错了或者别的? HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: j

测试-HTTP Status 500 - For input string: &amp;amp;quot;3.0&amp;amp;quot;

问题描述 HTTP Status 500 - For input string: "3.0" 我在做一个增加数据功能的网页,测试时出现了错误提示如下(输入整型数据时不报错,但是输入浮点型数据时却报错): java.lang.NumberFormatException: For input string: "2.0" java.lang.NumberFormatException.forInputString(Unknown Source) java.lang.Int

http-HTTP Status 500 一直报错

问题描述 HTTP Status 500 一直报错 HTTP Status 500 - javax.servlet.ServletException: java.lang.NoClassDefFoundError: org/apache/struts/util/MessageResources type Exception report message javax.servlet.ServletException: java.lang.NoClassDefFoundError: org/apac

http-tomcat一直出这个问题HTTP Status 500

问题描述 tomcat一直出这个问题HTTP Status 500 HTTP Status 500 - java.lang.NullPointerException type Exception report message java.lang.NullPointerException description The server encountered an internal error that prevented it from fulfilling this request. excep

jsp-HTTP Status 500 - Unable to compile class for JSP

问题描述 HTTP Status 500 - Unable to compile class for JSP 求大牛求解!新手不了解 j点击Jsp页面出现的错误 type Exception report message Unable to compile class for JSP description The server encountered an internal error that prevented it from fulfilling this request. except

loginaction-http Status 500 app.action.LoginAction.index()

问题描述 http Status 500 app.action.LoginAction.index() HTTP Status 500 - app.action.LoginAction.index() 错误信息是: type Exception report message app.action.LoginAction.index() description The server encountered an internal error that prevented it from fulfi