<?xml version="1.0" encoding="UTF-8" ?> 
- <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
- <servlet>
  <description>for users login</description> 
  <display-name>for users login</display-name> 
  <servlet-name>LoginAction</servlet-name> 
  <servlet-class>com.hxl.eb.servlet.LoginAction</servlet-class> 
  </servlet>
- <servlet-mapping>
  <servlet-name>LoginAction</servlet-name> 
  <url-pattern>/servlet/LoginAction</url-pattern> 
  </servlet-mapping>
- <welcome-file-list>
  <welcome-file>index.jsp</welcome-file> 
  </welcome-file-list>
- <login-config>
  <auth-method>BASIC</auth-method> 
  </login-config>
  </web-app>
表单就是一个简单的用户名密码验证表单,action=“servlet/LoginAction”,点击了提交按钮后就弹出下面的错误:
HTTP Status 404 - /eBookStore/LoginAction--------------------------------------------------------------------------------type Status reportmessage /eBookStore/LoginActiondescription The requested resource (/eBookStore/LoginAction) is not available.
--------------------------------------------------------------------------------Apache Tomcat/5.5.27
请问大家怎么解决啊?先谢谢大家

解决方案 »

  1.   

    The requested resource (/eBookStore/LoginAction) is not available.
    请求资源无效!应该是servlet/LoginAction吧
      

  2.   

      <url-pattern>/servlet/LoginAction</url-pattern> 
    应该这个地方有点问题!
      

  3.   

    http://localhost:8080/项目名/servlet/LoginAction eBookStore这是你项目名?
      

  4.   

    description The requested resource (/eBookStore/LoginAction) is not available.
    改一下你action="/servlet/LoginAction";
      

  5.   

    action=“servlet/LoginAction”, 如果你的url-pattern="*.do"
     改成 action=“servlet/LoginAction.do”, 
     url-pattern="*.action"action=“servlet/LoginAction.action”, 
      

  6.   

    不好意思,现在才结贴,三楼说的是,我发的不是同一次运行的结果,都是 <url-pattern>/servlet/LoginAction</url-pattern> 改来改去改错了 <url-pattern>/servlet/LoginAction</url-pattern> --->form的action应该是servlet/LoginAction <url-pattern>/LoginAction</url-pattern> --->form的action应该是LoginAction