ActionForm类如下:
import org.apache.struts.action.*;
import javax.servlet.http.*;public class aaActionForm extends ActionForm {
  private String a;
  private String b;
  public void setA(String a) {
    this.a = a;
  }
  public String getA() {
    return a;
  }
  public void setB(String b) {
    this.b = b;
  }
  public String getB() {
    return b;
  }
  public ActionErrors validate(ActionMapping actionMapping, HttpServletRequest httpServletRequest) {
    /**@todo: finish this method, this is just the skeleton.*/
    return null;
  }
  public void reset(ActionMapping actionMapping, HttpServletRequest httpServletRequest) {
  }
}

解决方案 »

  1.   

    struts-config.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.0//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd">
    <struts-config>
      <form-beans>
        <form-bean name="aaActionForm" type="abc.aaActionForm" />
      </form-beans>
      <global-forwards>
        <forward name="mm" path="/mm" />
      </global-forwards>
      <action-mappings>
        <action name="aaActionForm" type="abc.aaAction" scope="request" path="/aaAction" />
      </action-mappings>
    </struts-config>
      

  2.   

    //这里是不是应该有package abc???
    import org.apache.struts.action.*;
    import javax.servlet.http.*;public class aaActionForm extends ActionForm {
      private String a;
      private String b;
      public void setA(String a) {
        this.a = a;
      }
      public String getA() {
        return a;
      }
      public void setB(String b) {
        this.b = b;
      }
      public String getB() {
        return b;
      }
      public ActionErrors validate(ActionMapping actionMapping, HttpServletRequest httpServletRequest) {
        /**@todo: finish this method, this is just the skeleton.*/
        return null;
      }
      public void reset(ActionMapping actionMapping, HttpServletRequest httpServletRequest) {
      }
    }
      

  3.   

    原因就是在:aaActionForm aa=(aaActionForm)actionForm;(在aaAction类中)aaActionForm类在aaAction类中不认,都在一个包里不知为啥不认识,可能是配置有问题,但是用的是配置应该没问题的。而且不知怎末弄得有时还正常,请高手指教了。谢谢了。
      

  4.   

    在action的actionform配置中加上input选项,指明使用form的页面试试
      

  5.   

    <action-mappings>
        <action name="aaActionForm" type="abc.aaAction" scope="request" path="/aaAction" />这里的type应该是form bean的name属性,应该为aaActionFormname的取值应该是jsp提交的***.do去掉.do剩下的***部分。
    你现在这样子,那么jsp那边提交的就应该写成aaActionForm.do
      

  6.   

    给你一点建议:
    本人刚学Struts1.1在Weblogic上不管怎样都会有一点问题,在tomcat上就没有,你可以试试!!!
      

  7.   

    回复人: Eraserpro(穷...哪位好人拿钱砸我吧!!!) ( ) 信誉:110  2004-12-15 15:32:00  得分: 0  
     
     
       没加package,加上
      
     
    !!!!!!!!
      

  8.   

    不是package的问题,本来程序有的我没贴出来。“幻想”老兄说的我也有同感,不过有时候那个服务器都不行,我感觉应该是服务器的问题吧,因为一些.xml文件都是自动生成的应该不会有错。欢迎讨论。