if(password1.equals(password2)){-->if(password1!=null &&  password1.equals(password2)){

解决方案 »

  1.   

    目录结构有问题,应该是这样吧:
    webapps\strutstest\
    webapps\strutstest\register.jsp;success.html;failure.html
    webapps\strutstest\WEB-INF\classes\app\RegisterAction.class;RegisterForm.class
    webapps\strutstest\WEB-INF\struts-config.xml;web.xml
    webapps\strutstest\WEB-INF\lib\....
    webapps\strutstest\WEB-INF\tld\....
    register.jsp:
    ......
    <form action="register.do">
        name:    <input name="username" type="text"><br>
        password:<input name="password1" type="password"><br>
        confirm: <input name="password2" type="password">
    </form>
    ......
    应该就可以了
      

  2.   

    是笔误webapps\strutstest\WEB-INF\tld.以上的都试验了。不行的/
    <%@ taglib uri="/WEB-INF/tld/struts-html.tld" prefix="form" %>
    <form:form action="/register">
    username:<form:text property="username"/><br>
    password1:<form:text property="password1"/><br>
    password2:<form:text property="password2"/><br>
    <form:submit value="Register"/>
    </form:form>register.jsp页面可以出来。但提交后,就成了空白拉。
      

  3.   

    你的forword定义是:
     <forward name="success" path="/success.html"/>
    <forward name="failure" path="/failure.html"/>不知道你的success.html和failure.html是怎么写的,action执行以后,如果成功,则返回success.html,如果失败,则返回到failure.html中,估计你的这两个文件有问题