你的目录中是否有这个类dw.strust.example.ValidateEmployeeAction;
或者ValidateEmployeeAction这个类经过编译后是否放到了classes\dw\strustexample目录下?

解决方案 »

  1.   

    初步诊断问题出在web.xml 中的这一句
    <!--param-name>application</param-name>
    改为
    <param-name>application</param-name>
      

  2.   

    1.
    dw.strust.example.ValidateEmployeeAction
    在classes\dw\strust\example\下的2.
    我现在已经没有用<bean:message>所以我把 
    <!--param-name>application</param-name>
    <param-value>ApplicationResources</param-value-->注释了3.
    我把web.xml里的
    <load-on-startup>2</load-on-startup>
    注释了,现在能启动了,但在打开web页面inputContent.jsp的时候出现
    org.apache.jasper.JasperException: /inputContent.jsp(35,6) jsp.error.unterminated.tag
    at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:94)
    ...
    现在我把inputContent.jsp里的所有用的标签都去掉了
    就保留
    <%@ taglib uri="/html" prefix="html"%>
    还是有这个错误,感觉是<%@ taglib uri="/html" prefix="html"%>
    错了,但不知道哪里错了。。
    请高手帮我分析一下,挽救一个郁闷了一个星期的人,谢谢
      

  3.   

    应该是这样
    <%@ taglib uri="/WEB-INF/Struts-html.tld" prefix="html" %>
    你要保证你的WEB-INF文件夹下有Struts-html.tld文件
    以及其他文件
      

  4.   

    <%@ taglib uri="/html" prefix="html"%>
    将其中的uri和web.xml中taglib中定义的uri写成一致!
      

  5.   

    我刚刚又多适了几次,
    在inputContent.jsp里保留
    <%@ taglib uri="/html" prefix="html"%>
    <%@ taglib uri="/bean" prefix="bean"%>
    <%@ taglib uri="/logic" prefix="logic"%>
    <%@ taglib uri="/app" prefix="app"%>
    页面能打开了但是如过一旦加了
    <html:text property="name"/>标签
    打开页面就出现错误:
    org.apache.jasper.JasperException: Cannot find bean org.apache.struts.taglib.html.BEAN in any scope
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
    ..
    大概意思是不能找到这个org.apache.struts.taglib.html.BEAN 在 any scope
    是什么原因呢而且我把<html:text property="name"/>删了,
    改为
    <html:form action="validateEmployee.do">
    </html:form>
    打开页面就出现错误:
    org.apache.jasper.JasperException: Cannot find ActionMappings or ActionFormBeans collection
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)也就是说现在,只要使用了标签就出错,请教各位是什么原因引起的呢?谢谢你们
      

  6.   

    <html:text property="name"/>
    你有这样的标签的话,你的ActionForm这个bean中一定有一个成员名称是name,这个名称和property是对应的,在提交时,你的这些数据会被control servlet提交到你写的那个ActionForm去组合数据,如果你的表单中的property和那个bean中的成员不对应的话,就会出现问题!
    你是否写了ActionForm了
      

  7.   

    感觉会不会是
    struts-config.xml里的配置映射问题?
      

  8.   

    有两个bean
    一个是EmployeeForm:
    package dw.strust.example;
    import org.apache.struts.action.ActionForm;/**
     * <p>Title: </p>
     * <p>Description: </p>
     * <p>Copyright: Copyright (c) 2004</p>
     * <p>Company: </p>
     * @author not attributable
     * @version 1.0
     */public class EmployeeForm extends ActionForm{
      private String name = "";
      private String department = "";
      private String[] skills;  public String getName(){
        return name;
      }  public void setName(String name){
        this.name = name;
      }  public String getDepartment(){
        return department;
      }  public void setDepartment(String department){
        this.department = department;
      }  public String[] getskills(){
        return skills;
      }  public void setSkills(String[] skills){
        this.skills = skills;
      }
      public EmployeeForm() {
      }
    }一个是ValidateEmployeeAction:package dw.strust.example;
    import org.apache.struts.action.*;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.ServletException;
    import java.io.IOException;
    import java.util.List;/**
     * <p>Title: </p>
     * <p>Description: </p>
     * <p>Copyright: Copyright (c) 2004</p>
     * <p>Company: </p>
     * @author not attributable
     * @version 1.0
     */public class ValidateEmployeeAction extends Action{
      public ValidateEmployeeAction() {
      }  public ActionForward perform(ActionMapping mapping,
                                   ActionForm form,
                                   HttpServletRequest request,
                                   HttpServletResponse response)
                                   throws IOException,ServletException{
        ActionErrors errors = new ActionErrors();
        EmployeeForm empForm = (EmployeeForm)form;    String name = empForm.getName();
        if(name.trim().equals("")){
          ActionError error = new ActionError("error.missing.name");
          errors.add(ActionErrors.GLOBAL_ERROR,error);
        }    String department = empForm.getDepartment();
        if(department.trim().equals("")){
          ActionError error = new ActionError("error.missing.department");
          errors.add(ActionErrors.GLOBAL_ERROR,error);
        }    String[] skills = empForm.getskills();
        if(skills == null){
          ActionError error = new ActionError("error.missing.skills");
          errors.add(ActionErrors.GLOBAL_ERROR,error);
        }    return mapping.findForward("success");
      }
    }
      

  9.   

    你把现在tomcat启动的错误日志和struts-config.xml贴出来看看!
      

  10.   

    struts-config.xml文件:<?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE struts-config PUBLIC
     "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"
     "http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd">
    <struts-config>
       <form-beans>
          <form-bean name="empForm" type="dw.strust.example.EmployeeForm"/>
        </form-beans>
        
        <action-mappings>
          <action path="/validateEmployee" type="dw.strust.example.ValidateEmployeeAction" name="empForm scope="request" input="/inputContent.jsp">
            <forward name="success" path="/outputContent.jsp"/>
          </action>
        </action-mappings>
    </struts-config> 现在启动没错误了,
    就是运行inputContent.jsp页面的时候出先错误
    org.apache.jasper.JasperException: /inputContent.jsp(21,5) No such tag test in the tag library imported with prefix htmlat org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:94)
    at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:428)
    at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:219)
    at org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:705)
    at org.apache.jasper.compiler.Parser.parseElements(Parser.java:804)
    <%@ taglib uri="/html" prefix="html"%>
    <%@ taglib uri="/bean" prefix="bean"%>
    <%@ taglib uri="/logic" prefix="logic"%>
    <%@ taglib uri="/app" prefix="app"%>
    <html>
      <head>
        <title></title>
      </head>
      <body>
        <html:errors/>
        <app:departmentList/>
        <app:skillsList/>
         <html:form action="validateEmployee.do">
    <table>
      <tr>
        <td align="right">
      name
        </td>
        <td>
       <html:test property="name"/>
                 </td>
      </tr>
      <tr>
        <td align="center">
      department
        </td>
        <td>
    <html:select property="department">
      <html:options name="departmentList"/>
    </html:select>
        </td>
      </tr>
      <tr>
        <td align="right" valign="top">
      skills
        </td>
        <td>
      <logic:iterate id="curentSkill" name="skillsList">
        <html:multibox property="skills">
      <%= currentSkill %>
    </html:multibox>
      </logic:iterate>
        </td>
      </tr>
      <tr>
        <td colspan="2" align="center">
        </td>
      </tr>
    </table>
        </html:form>
      </body>
    </html>
      

  11.   

    打错了个字
    test->text但还是提示
    Generated servlet error:
        [javac] Since fork is true, ignoring compiler setting.
        [javac] Compiling 1 source file
        [javac] Since fork is true, ignoring compiler setting.
        [javac] D:\javaTool\Tomcat 4.1\work\Standalone\localhost\dwtest\inputContent_jsp.java:159: cannot resolve symbol
        [javac] symbol  : variable currentSkill 
        [javac] location: class org.apache.jsp.inputContent_jsp
        [javac]                   out.print( currentSkill );
        [javac]                              ^
        [javac] 1 error
      

  12.   

    <html:test property="name"/>
    改成<html:text property="name"/>
      

  13.   

    取掉inputContent.jsp里的:
    <logic:iterate id="curentSkill" name="skillsList">
      <html:multibox property="skills">
        <%= currentSkill %>
      </html:multibox>
    </logic:iterate>还是出现这个错误:
    org.apache.jasper.JasperException: Cannot find ActionMappings or ActionFormBeans collection
    到底是什么原因呢,
      

  14.   

    <%= currentSkill %>
    改成<bean:write name="currentSkill"/>看看!
    你把上面的那行去掉当然不行啊,这样在ActionForm bean中就不能找到和skills对应的property了!
      

  15.   

    老是出现这个原因怎么搞的啊,郁闷啊
    org.apache.jasper.JasperException: Cannot find ActionMappings or ActionFormBeans collection
    WEB-INF/lib/下有struts.jar
    WEB-INF/classes/下有dw.strust.example.EmployeeForm
    和dw.strust.example.ValidateEmployeeAction
    WEB-INF/下有struts-logic.tld,struts-bean.tld,struts-html.tld,struts-config.xml
    web.xml,app.tld我现在已经把表单只设置了一个字段了,就一个name
    EmployeeForm.java里面就一个name属性:package dw.strust.example;
    import org.apache.struts.action.ActionForm;
    public class EmployeeForm extends ActionForm{
      private String name = "";  public String getName(){
        return name;
      }  public void setName(String name){
        this.name = name;
      }
      public EmployeeForm() {
      }
    }ValidateEmployeeAction.java也只留下了name判断:
    package dw.strust.example;
    import org.apache.struts.action.*;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.ServletException;
    import java.io.IOException;
    import java.util.List;/**
     * <p>Title: </p>
     * <p>Description: </p>
     * <p>Copyright: Copyright (c) 2004</p>
     * <p>Company: </p>
     * @author not attributable
     * @version 1.0
     */public class ValidateEmployeeAction extends Action{
      public ValidateEmployeeAction() {
      }  public ActionForward perform(ActionMapping mapping,
                                   ActionForm form,
                                   HttpServletRequest request,
                                   HttpServletResponse response)
                                   throws IOException,ServletException{
        ActionErrors errors = new ActionErrors();
        EmployeeForm empForm = (EmployeeForm)form;    String name = empForm.getName();
        if(name.trim().equals("")){
          ActionError error = new ActionError("error.missing.name");
          errors.add(ActionErrors.GLOBAL_ERROR,error);
          System.out.println("sssss");
        }
        return mapping.findForward("success");
      }
    }struts-config.xml内容:
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE struts-config PUBLIC
     "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"
     "http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd">
    <struts-config>
       <form-beans>
          <form-bean name="empForm" type="dw.strust.example.EmployeeForm"/>
        </form-beans>
        
        <action-mappings>
          <action path="/validateEmployee" type="dw.strust.example.ValidateEmployeeAction" name="empForm scope="request" validate="true" input="/inputContent.jsp">
            <forward name="success" path="/outputContent.jsp"/>
          </action>
        </action-mappings>
    </struts-config> inputContent.jsp内容:
    <%@ taglib uri="/html" prefix="html"%>
    <%@ taglib uri="/bean" prefix="bean"%>
    <%@ taglib uri="/logic" prefix="logic"%>
    <%@ taglib uri="/app" prefix="app"%>  //自己的定义的标签
    <html>
      <head>
        <title></title>
      </head>
      <body>
    <html:form action="/validateEmployee.do">
    <table>
     <tr>
       <td align="right">
         name
       </td>
       <td>
        <html:text property="name"/>
       </td>
      </tr>
     </table>
    </html:form>
    </body>
    </html>
    哪位大哥救命啊,我不想在郁闷一个星期,谢谢高手和前辈帮忙指点分析,已经很尽力了,,快疯了
      

  16.   

    strust-config.xml的配置中的<action path="/validateEmployee" type="dw.strust.example.ValidateEmployeeAction" name="empForm scope="request" input="/inputContent.jsp">
    name后面的值少个引号啊!name="empForm 
      

  17.   

    <!-- tag libs -->
      <taglib>
        <taglib-uri>struts/bean-el</taglib-uri>
        <taglib-location>/WEB-INF/struts-bean-el.tld</taglib-location>
      </taglib>  <taglib>
        <taglib-uri>struts/html-el</taglib-uri>
        <taglib-location>/WEB-INF/struts-html-el.tld</taglib-location>
      </taglib>  <taglib>
        <taglib-uri>struts/logic-el</taglib-uri>
        <taglib-location>/WEB-INF/struts-logic-el.tld</taglib-location>
      </taglib>
      
      <taglib>
        <taglib-uri>jstl/c</taglib-uri>
        <taglib-location>/WEB-INF/c.tld</taglib-location>
      </taglib>
    在web.xml中配置以上这些了吗??
      

  18.   

    还有标签应该是这样的吧!
    <%@ taglib uri="struts/html-el" prefix="html" %>
      

  19.   

    你的页面在web-info下放着没,我在你的web-info下没有发现那几个jsp页面呀。!!!!!!!!!!11111
      

  20.   

    彻底郁闷了,现在不知道怎么搞的又好,
    开始我还以为是没有
    <global-forwards>  
    <forward name="failed" path="/failed"/> 
    <forward name="success" path="/success.do"/> 
    </global-forwards> 
    而出错的,现在不管加还是去,都对了, 
    在action 里面+forwrad 也对了,郁闷
    <action path="/validateEmployee" type="dw.strust.example.ValidateEmployeeAction" name="empForm scope="request" validate="true" input="/inputContent.jsp">
    <forward name="success" path="/outputContent.jsp"/>
    </action>
    不知不觉自己就好了,~~~~~~
    哎。。
    谢谢大家,帮助我,真是谢谢你们,,你们都是好人,我爱你们:)