我的struts.xml如下:
<?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE struts PUBLIC
         "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
         "http://struts.apache.org/dtds/struts-2.0.dtd">
   
 <struts>
  <constant name="struts.devMode" value="true" />
 
     <package name="com.rong.action" extends="struts-default" namespace="/">
         <!-- 用户登录 -->
        <action name="loginAction" class="com.rong.action.LoginAction">
            <result name="SUCCESS" type="redirect">/back/index.jsp</result>
            <result name="INPUT">/login.jsp</result>
        </action>
        <!-- 用户注册 -->
        <action name="registerAction" class="com.rong.action.RegisterAction">
            <result name="SUCCESS" type="redirect">/login.jsp</result>
            <result name="INPUT">/register.jsp</result>
        </action>
    </package>
</struts>

解决方案 »

  1.   

    web.xml如下:
    <?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">
     
         <!-- 用过滤器配置Struts2支持 -->
         <filter>
             <filter-name>struts2</filter-name>
            <filter-class>
                org.apache.struts2.dispatcher.FilterDispatcher
            </filter-class>
        </filter>
        <filter-mapping>
            <filter-name>struts2</filter-name>
           <url-pattern>/*</url-pattern>
        </filter-mapping>    <welcome-file-list>
            <welcome-file>login.jsp</welcome-file>
        </welcome-file-list>
    </web-app>
      

  2.   

    login.jsp如下:
     <%@ page language="java" import="java.util.*" pageEncoding="gbk"%>
     <%@ taglib prefix="s" uri="/struts-tags" %>
     <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
     <html>
         <head>
     
             <title>Login Page</title>
         </head>
     
       <body>
            <p><a href="register.jsp">用户注册</a>|用户登录</p>
                    <s:form action="loginAction" theme="simple">
               <table>
                    <tr>
                        <td style="text-align:right">
                            账号
                        </td>
                        <td>
                            <s:textfield name="name" label="账号" />                    </td>
                    </tr>
                    <tr>
                        <td style="text-align:right">
                            密码
                        </td>
                        <td>
                            <s:password name="pwd" label="密码" />
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align:right">
                            验证码
                        </td>
                        <td>
                           <s:textfield name="inputCertCode" label="验证码" cssStyle="width:100px"/>
                            <img src="other/makeCertPic.jsp">
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align:right">
                            <s:submit value="登录" />
                        </td>
                        <td style="text-align:left">
                            <s:reset value="取消"/>
                        </td>
                    </tr>
                </table>
            </s:form>
            <s:fielderror cssStyle="color:red"/>
        </body>
    </html>  
      <body>
        This is my JSP page. <br>
      </body>
    </html>
      

  3.   

    刚学习ssh,不是很了解他们的流程
      

  4.   

    3楼啊login。jsp那里就有标签啊
      

  5.   

    还有我想问下要怎么输入地址名才可以访问login。jsp的标签?
      

  6.   

     HTTP Status 404 - Status report
    The requested resource () is not available.
      

  7.   

      我也碰到过类似的问题。最后解决了。原因是一开始用的tomcat5.0,总是提示找不到,后面改用tomcat6.0就可以找到文件了
      

  8.   

    struts.xml里action的class写得不对,仔细查一遍吧。