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) {
}
}
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) {
}
}
<?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>
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) {
}
}
<action name="aaActionForm" type="abc.aaAction" scope="request" path="/aaAction" />这里的type应该是form bean的name属性,应该为aaActionFormname的取值应该是jsp提交的***.do去掉.do剩下的***部分。
你现在这样子,那么jsp那边提交的就应该写成aaActionForm.do
本人刚学Struts1.1在Weblogic上不管怎样都会有一点问题,在tomcat上就没有,你可以试试!!!
没加package,加上
!!!!!!!!