日期:2014-05-20  浏览次数:20920 次

我再问下servlet是怎么配置的吧,上次我自己好像没有说清楚,有热心朋友帮助但是还是没有解决
首先,我的server.xml文件已经被修改,其中改动部分为
<Context path="/jspex" docBase="d:/jsp/jspex" reloadable="true" >
  </Context>
现在我在tocat文件夹中的webapps中建立了的文件如下
\jsp\jspex\WEB-INF\classes\test\HelloWorld.class


\jsp\jspex\WEB-INF\web.xml


HelloWorld.java在test包中


请问该怎么配置web.xml


头疼半天了……


错误代码是:
HTTP Status 404 - /jspex/HelloWorld

type Status report

message /jspex/HelloWorld

description The requested resource (/jspex/HelloWorld) is not available.

Apache Tomcat/7.0.22

------解决方案--------------------
如果那样的话,web.xml配置旧象在另一个帖子一样配置,你看看在server.xml里面,找到这块:
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true">
改成:
<Host name="localhost" appBase="webapps\jsp"
unpackWARs="true" autoDeploy="true">
试试。