使用struts的时候form用struts的,不用html本身的

同样的struts-config.xml, web.xml的配置,使用2个版本的form,只有struts的form才能成功运行

使用html版本的form导致post的路径不对,报404

HTML版form

    <form action="/ch16/simple.do" method="post">
        姓名:<input type="text" name="name"/><br>
        密码:<input type="password" name="password"/><br>
        性别:<input type="radio" name="sex" value="男"/><input type="radio" name="sex" value="女"/><br>
        简介:<textarea rows="3" cols="30" name="note"></textarea><br>
        <input type="hidden" name="id" value="30"/>
        <input type="submit" value="提交"/>
        <input type="reset" value="重置"/>
    </form>

Struts版form

    <html:form action="/ch16/simple.do" method="post">
        姓名:<html:text property="name"/><br>
        密码:<html:password property="password"/><br>
        性别:<html:radio property="sex" value="男"/><html:radio property="sex" value="女"/><br>
        简介:<html:textarea rows="3" cols="30" property="note"/><br>
        <html:hidden property="id" value="30"/>
        <html:submit value="提交"/>
        <html:reset value="重置"/>
    </html:form>
原文地址:https://www.cnblogs.com/qrlozte/p/3528533.html