]<?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">
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter-class> </filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping></web-app>[/code
下面的这个是一个网页表单的
[code=Java]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>注册表单</title>
</head><body>
<form action="RequestDemo.jsp" method="post">
<table>
<tr>
<td>用户名</td>
<td><input type="text" name="username"/></td>
</tr>
<tr>
<td>密码</td>
<td><input type="password" name="upassword"/></td>
</tr>
<tr>
<td>确认密码</td>
<td><input type="password" name="repassword"/></td>
</tr>
<tr>
<td>姓名</td>
<td><input type="text" name="name"/></td>
</tr>
<tr>
<td>年龄</td>
<td><input type="text" name="age"/></td>
</tr>
<tr>
<td>性别</td>
<td>
<input type="radio" name="sex" value="男"/>男
<input type="radio" name="sex" value="女"/>女
</td>
</tr>
<tr>
<td><input type="submit" value="注册"/></td>
<td><input type="reset" value="重置"/></td>
</tr>
</table>
</form>
</body>
</html>
这个是配置struts的
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "htpp://struts.apache.org/dtds/struts-2.3.dtd">
<struts>
<package name="struts2" extends="struts-default">
<action name="register" class="com.liujie.action.RegisterAction">
<result name = "success">/*</result>
</action>
</package>
</struts>为什么还是出现:HTTP Status 404 - /Struts2TestRegister/register.action--------------------------------------------------------------------------------type Status reportmessage /Struts2TestRegister/register.actiondescription The requested resource (/Struts2TestRegister/register.action) is not available.
--------------------------------------------------------------------------------Apache Tomcat/6.0.35啊?
<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">
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter-class> </filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping></web-app>[/code
下面的这个是一个网页表单的
[code=Java]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>注册表单</title>
</head><body>
<form action="RequestDemo.jsp" method="post">
<table>
<tr>
<td>用户名</td>
<td><input type="text" name="username"/></td>
</tr>
<tr>
<td>密码</td>
<td><input type="password" name="upassword"/></td>
</tr>
<tr>
<td>确认密码</td>
<td><input type="password" name="repassword"/></td>
</tr>
<tr>
<td>姓名</td>
<td><input type="text" name="name"/></td>
</tr>
<tr>
<td>年龄</td>
<td><input type="text" name="age"/></td>
</tr>
<tr>
<td>性别</td>
<td>
<input type="radio" name="sex" value="男"/>男
<input type="radio" name="sex" value="女"/>女
</td>
</tr>
<tr>
<td><input type="submit" value="注册"/></td>
<td><input type="reset" value="重置"/></td>
</tr>
</table>
</form>
</body>
</html>
这个是配置struts的
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "htpp://struts.apache.org/dtds/struts-2.3.dtd">
<struts>
<package name="struts2" extends="struts-default">
<action name="register" class="com.liujie.action.RegisterAction">
<result name = "success">/*</result>
</action>
</package>
</struts>为什么还是出现:HTTP Status 404 - /Struts2TestRegister/register.action--------------------------------------------------------------------------------type Status reportmessage /Struts2TestRegister/register.actiondescription The requested resource (/Struts2TestRegister/register.action) is not available.
--------------------------------------------------------------------------------Apache Tomcat/6.0.35啊?
怎么是个jsp不是你配置的struts action?
<%@page language="java" pageEncoding="gb2312"%>
<html>
<head>
<title>注册页面</title>
</head>
<body>
<form action="register.action" method="post">
<table>
<tr>
<td>
用户名
</td>
<td><input type="text" name="username"/></td>
</tr>
<tr>
<td>
密码
</td>
<td><input type="password" name="upassword"/></td>
</tr>
<tr>
<td>
确认密码
</td>
<td><input type="password" name="repassword"/></td>
</tr>
<tr>
<td>
姓名
</td>
<td><input type="text" name="name"></td>
</tr>
<tr>
<td>
年龄
</td>
<td><input type="text" name="age"></td>
</tr>
<tr>
<td>
邮箱地址
</td>
<td><input type="text" name="email"></td>
</tr>
<tr><td>生日</td><td><input type = "text" name = "birth"></td></tr>
<tr>
<td>
<input type="submit" value="提交" />
</td>
<td>
<input type="reset" value="重置" />
</td>
</tr>
</table> </form>
</body>
</html>
不好意思哈