关于java servlet的小问题,比较基础

来源:百度知道 编辑:UC知道 时间:2024/04/29 18:49:04
一个小问题。
http://localhost/myapp1/servlet/chapter2.SimpleServlet
这样运行后,总是报错:type Status report
message /myapp1/servlet/chapter2.SimpleServlet
description The requested resource /myapp1/servlet/chapter2.SimpleServlet) is not available.应该如何设置。是否用再web.xml中添加什么

-----下面是log4J的配置方式------
<servlet>
<servlet-name>log4j-init</servlet-name>
<servlet-class>com.neusoft.ehr.common.Log4jInit</servlet-class>
<init-param>
<param-name>log4j-init-file</param-name>
<param-value>/WEB-INF/classes/property/log4j.properties</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>

-------------------------------------
只要你的类直接或间接继承HttpServlet就可以