刚学struts就遇到问题,那位高手能给我看看,在线等
+++++++++++++++++++++++++++++++++++++++++++++++++++++
报的错误
HTTP Status 500 -
--------------------------------------------------------------------------------
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Cannot retrieve mapping for action /HelloWordAction
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
org.apache.jsp.HelloWord_jsp._jspService(HelloWord_jsp.java:103)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
javax.servlet.jsp.JspException: Cannot retrieve mapping for action /HelloWordAction
org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:810)
org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:506)
org.apache.jsp.HelloWord_jsp._jspx_meth_html_form_0(HelloWord_jsp.java:120)
org.apache.jsp.HelloWord_jsp._jspService(HelloWord_jsp.java:89)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.
+++++++++++++++++++++++++++++++++++++++++++++++++++++
页面
<!-- Copyright (c) 2002 by ObjectLearn. All Rights Reserved. -->
<%@ page language="java" pageEncoding="GB2312" %>
<%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template" %>
<jsp:useBean id="HelloWordForme"class="web.form.HelloWordForm"scope="page"/>
<html>
<head>
<title> Hello Word </title>
</head>
<body>
<html:form action="/HelloWordAction"method="post">
请输入:Hello Word:<html:text property="word"/><html:submit/>
</html:form>
<br>
+++++++++++++++++++++++++++++++++++++++++++++++++++++
config中配置
<?xml version="1.0" ?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
<struts-config>
<form-beans>
<form-bean name="HelloWordForm" type="web.form.HelloWordForm"/>
</form-beans>
<global-exceptions/>
<global-forwards/>
<action-mappings>
<action path = "/HelloWordAction"
type= "web.action.HelloWordAction"
name="HolloWordForm"
validate="false"
scope="session"
>
<forward name="success" path="/index.jsp"/>
</action>
</action-mappings>
<controller/>
<message-resources parameter="ApplicationResources"/>
</struts-config>
<bean:write name="HelloWordForme" scope="session" property="word"/>
</body>
</html>