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>
  • 相关阅读:
    Nginx 之负载均衡与反向代理
    PHP 之快递100接口封装
    Mongodb非关系型数据库
    Sphinx全文索引引擎
    PHP 之文件上传类封装
    PHP 之验证码类封装
    小程序 之左滑删除
    PHP 之实现按日期进行分组、分页
    System.IO 二
    IIS配置MIME类型
  • 原文地址:https://www.cnblogs.com/qrlozte/p/3528533.html
Copyright © 2011-2022 走看看