这是提交的表单
<form  method="post" name="fm" action="="checkadmin" onsubmit="return chk();">
</form>checkadmin 在此目录下 WEB-INF\classes\com\wuliu\servlet\adminWEB-INF中有    
    <servlet>
    <description>This is the description of my J2EE component</description>
    <display-name>This is the display name of my J2EE component</display-name>
    <servlet-name>checkadmin</servlet-name>
    <servlet-class>com.wuliu.servlet.admin.CheckAdmin</servlet-class>
    </servlet>  <servlet-mapping>
    <servlet-name>checkadmin</servlet-name>
    <url-pattern>/admin/checkadmin</url-pattern>
  </servlet-mapping>
但在运行时出现
HTTP Status 404 - /myapp/wuliu/WebRoot/admin/checkadmin--------------------------------------------------------------------------------type Status reportmessage /myapp/wuliu/WebRoot/admin/checkadmindescription The requested resource (/myapp/wuliu/WebRoot/admin/checkadmin) is not available.

解决方案 »

  1.   

    WEB-INF 下的web.xml

    servlet>
      <description>This is the description of my J2EE component</description>
      <display-name>This is the display name of my J2EE component</display-name>
      <servlet-name>checkadmin</servlet-name>
      <servlet-class>com.wuliu.servlet.admin.CheckAdmin</servlet-class>
      </servlet>  <servlet-mapping>
      <servlet-name>checkadmin</servlet-name>
      <url-pattern>/admin/checkadmin</url-pattern>
      </servlet-mapping>
      

  2.   

    form 标签中 action属性的值改为: action="/admin/checkadmin"
      

  3.   

    description The requested resource (/myapp/wuliu/WebRoot/admin/checkadmin) is not available.按照你的配置 请求路径应该是 /myapp/admin/checkadmin 才对
    form method="post" name="fm" action="="/admin/checkadmin" onsubmit="return chk();">
    </form>你要写成这样子才行。否则 容器会自动把当前jsp页面所在的路径加入到前面
    我估计你的jsp就在/wuliu/WebRoot 下 哈哈
     
     
      

  4.   

    照ls的说的,出现下面错误 
    The requested resource (/myapp/wuliu/WebRoot/admin/=) is not available.
      

  5.   

    我估计你的jsp就在/wuliu/WebRoot 
    是在/wuliu/WebRoot/admin下面
      

  6.   

    myapp/wuliu/WebRoot/admin/=你这个=号那里来的啊
      

  7.   

    = 去掉了,还是有错误<form  method="post" name="fm" action="/admin/checkadmin" onsubmit="return chk();">依然报错
    The requested resource (/admin/checkadmin) is not available.
      

  8.   


    action中你要加上你的应用程序名称啊 !如果部署在根下 则 action 则表单中 action应该是 /admin/checkadmin
    如果应用程序名师 myapp 则 action应该是 /myapp/admin/checkadmin建议你页面引用jstl 标签<%@ taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core" %>
    <c:set var="ctx" value="${pageContext.request.contextPath}"/>然后表单请求的action就是 ${ctx}/admin/checkadmin