你的web。xml里面配置没,你的struts.xml有没有放错位置啊!我帮你调试看看

解决方案 »

  1.   

    我把你代码的那个包名去掉了.运行一次通过....代码如下
    这是SayHello.jsp 页面 
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
        pageEncoding="ISO-8859-1"%>
        <%@ taglib prefix="s" uri="/struts-tags" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Insert title here</title>
    </head>
    <body> 
            <h3>Say "Hello" to: </h3> 
            <s:form name="HelloWorld" action="HelloWorld"> 
                Name: <s:textfield name="name" /> 
                <s:submit> </s:submit> 
            </s:form> </body>
    </html>这是HelloWorld.jsp页面 
    <%@ page contentType="text/html; charset=UTF-8" %> 
    <%@ taglib prefix="s" uri="/struts-tags" %> 
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 
    <html> 
        <head> 
            <title>Hello </title> 
        </head> 
        <body> 
            <h3> <s:property value="name" /> </h3> 
        </body> 
    </html> 这是tutorial.java package tutorial;import com.opensymphony.xwork2.ActionSupport;public class tutorial extends ActionSupport {
    private String name; 
        
        public String getName() { 
            return name; 
        } 
        
        public void setName(String name) { 
        System.out.println(name); 
            this.name = name; 
        } 
        
        public String execute()throws Exception  { 
            name = "Hello, " + name + "!"; 
            System.out.println(name); 
            return SUCCESS; 
        } }
    这是配置文件 
    <?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>
    <include file="/struts-default.xml"></include>
    <package name="tutorialone" extends="struts-default"> 
            <action name="HelloWorld" class="tutorial.tutorial"> 
                <result>HelloWorld.jsp </result> 
            </action> 
        </package> </struts>
      

  2.   

    要学会看错误信息,配置问题肯定是你的xml出问题了,要么是web.xml,要么是struts.xml。不用看别处绝对是那个地方你写错了