在网上下载了一个Struts 实例运行OK,但自己做的实例却出现这种问题:
实例如下:
//////////////////////////////////////////////////login3.jsp
<%@page contentType="text/html; charset=GBK"%>
<%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<html:html>
<head>
<title>login3</title></head>
<body bgcolor="#ffffff">
  <html:form method="POST" action="login3Action.do" focus="name">
    <html:text property="name" size="30"/>
    <br>
    <html:text property="pwd" size="20"/>
    <br>
    <html:submit value="提交"/>
    <br>
    <html:reset/>
</html:form>
</body>
</html:html>//////////////////////////////login3Action ///////////////////////
package login3;import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionForm;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.Action;public class login3Action extends Action {
    public login3Action() {
        try {
            jbInit();
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }    public ActionForward execute(ActionMapping actionMapping,
                                 ActionForm actionForm,
                                 HttpServletRequest servletRequest,
                                 HttpServletResponse servletResponse) {
        login3Form login3Form = (login3Form) actionForm;
        System.out.print("is not ok!");
        if(login3Form.getName().equals("qiyan"))
        {
         return actionMapping.findForward("ok");
        }else
        {
            return actionMapping.findForward("err");
        }
    }    private void jbInit() throws Exception {
    }
}////////////////////////////////////login3Form 
package login3;import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;
import javax.servlet.http.HttpServletRequest;public class login3Form extends ActionForm {
    private String name;
    private String pwd;
    public String getName() {
        return name;
    }    public void setName(String name) {
        this.name = name;
    }    public void setPwd(String pwd) {
        this.pwd = pwd;
    }    public String getPwd() {
        return pwd;
    }    public ActionErrors validate(ActionMapping actionMapping,
                                 HttpServletRequest httpServletRequest) {
            /** @todo: finish this method, this is just the skeleton.*/
        return null;
    }    public void reset(ActionMapping actionMapping,
                      HttpServletRequest servletRequest) {
    }
}
恩!!
这到底是有什么问题呢?呵呵!!请大家帮下忙!多谢了!