Topic: Servlet action is not available,问题在哪里?

  Print this page

1.Servlet action is not available,问题在哪里? Copy to clipboard
Posted by: ggjj_zhzz
Posted on: 2004-08-05 11:31

★http://localhost:2000/struts2/loginend.do

HTTP Status 404 - Servlet action is not available

--------------------------------------------------------------------------------

type Status report

message Servlet action is not available

description The requested resource (Servlet action is not available) is not available.

★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>2</load-on-startup>
</servlet>
  
<servlet-mapping>
  <servlet-name>action</servlet-name>
  <url-pattern>*.do</url-pattern>
</servlet-mapping>

★struts-config.xml:

<struts-config>
  <form-beans>
    <form-bean name="myFormBean" type="beans.struts.MyFormBean" />
  </form-beans>
  <global-forwards >
    <forward name="good" path="/good.do" />
    <forward name="bad" path="/bad.do" />
  </global-forwards>
  <action-mappings >
    <action path="/loginend" type="beans.actions.MyAction" name="myFormBean" scope="request" input="/main.jsp" />
    <action path="/good" forward="/good.jsp" />
    <action path="/bad" forward="/bad.jsp" />
  </action-mappings>
</struts-config>

★main.jsp:

<%@ page contentType="text/html;charset=gb2312" %>
<html>
<body>
<center>
<h1>Struts实例</h1>
</center>
<form action="loginend.do" method="post">
请输入姓名:<input type="text" name="name" size="20"><p>
<input type="submit" name="submit" value="提交">
</form>
</body>
</html>

万事开头难,请大家帮帮忙,拜托了~!!!!

2.Re:Servlet action is not available,问题在哪里? [Re: ggjj_zhzz] Copy to clipboard
Posted by: owlrose
Posted on: 2004-08-12 09:44

你是否sure struts的包都在 WEB-INF/lib/目录下了?

3.Re:Servlet action is not available,问题在哪里? [Re: ggjj_zhzz] Copy to clipboard
Posted by: webdev
Posted on: 2004-08-12 13:11

action="/loginend.do"

试试看


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923