zoukankan      html  css  js  c++  java
  • 使用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>
  • 相关阅读:
    数据一致性
    linux下关于程序性能和系统性能的工具、方法
    关于网站架构的一些文章
    列出man手册所有函数的方法
    dup和dup2函数以及管道的实现
    knowledge about apache
    第三篇 读后感
    课程作业02
    《大道至简》第二篇读后感
    课程作业01
  • 原文地址:https://www.cnblogs.com/qrlozte/p/3528533.html
Copyright © 2011-2022 走看看