我的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>
<?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>
<?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>
<%@ 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>
The requested resource () is not available.