首页 新闻 会员 周边 捐助

(Servlet action is currently unavailable)错误

0
悬赏园豆:20 [已关闭问题] 关闭于 2009-05-08 13:55

 这是struts的小例子,不过在点了提交按钮只后,出现如题的错误,望高人解答!!谢谢!!!

这是web.xml:

 <servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>

<load-on-startup>0</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
</web-app>

这是struts-config.xml:

<struts-config>

<form-beans>
<form-bean name="loginForm" type="struts.LoginForm"></form-bean>
</form-beans>

<action-mappings>
<action path="/login" type="struts.LoginAction" name="loginForm">
<forward name="loginSuccess" path="/LoginSuccess.jsp"></forward>
<forward name="loginFailure" path="/LoginFailure.jsp"></forward>
</action>
</action-mappings>

</struts-config>

这是jsp:
Code
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<form action="<%=request.getContextPath() %>/login.do" method="post">
username:
<input type="text" name="username"><br>
password:
<input type="password" name="password"><br>
<input type="submit" value="login">
</form>
</body>
</html>
 
惊云的主页 惊云 | 初学一级 | 园豆:180
提问于:2009-04-28 21:21
< >
分享
所有回答(1)
0

把 <form action="<%=request.getContextPath() %>/login.do" method="post">改成<form action="<%=request.getContextPath() %>/login" method="post">试试

splite | 园豆:205 (菜鸟二级) | 2012-01-19 11:43
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册