运行网页显示404错误,连着好几天不能解决,求大神指点
type Status report
message /5-4-2/
description The requested resource (/5-4-2/) is not available.
代码具体如下
struts.xml
<?xml version="1.0" encoding="GBK"?>
<struts>
<constant name="struts.devMode" value="true"/>
<constant name="struts.custom.il8n.resources" value="properties/myMessages"/>
<constant name="struts.il8n.encoding" value="GBK"/>
<package name="struts2_validate" extends="struts-default">
<action name="ValidationAction" class="com.ascent.action.ValidationAction">
<result>/Output.jsp</result>
<result name="input">/Input.jsp</result>
</action>
</package>
</struts>
ValidationAction.java
package com.ascent.action;
import com.opensymphony.xwork2.ActionSupport;
public class ValidationAction extends ActionSupport{
private static final long serialVersionUID=1L;
private String reqiuredString ;
public String getReqiuredString()
{
return reqiuredString;
}
public void setReqiuredString(String reqiuredString)
{
this.reqiuredString=reqiuredString;
}
public String execuye()
{
return SUCCESS;
}
}
ValidationAction-validation.xml
<?xml version="1.0" encoding="UTF-8"?>
<validators>
<field name="reqiuredString">
<field-validator type="reqiuredstring">
<message>This string is required </message>
</field-validator>
</field>
</validators>
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">
<display-name>Struts2</display-name>
<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>/index.jsp</welcome-file>
</welcome-file-list>
</web-app>
Input.jsp
<%@ page language="java" import="java.util.*" pageEncoding="gb2312"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<title>Validation</title>
<s:head/>
</head>
<body>
<s:form action="ValidationAction">
<s:textfield name="reqiuredString" lable="Required String"/>
<s:submit/>
</s:form>
</body>
</html>
Output.jsp
<%@ page language="java" import="java.util.*" pageEncoding="GB2312"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<title>Validation</title>
</head>
<body>
Required String:<s:property value="reqiuredString"/>
</body>
</html>