zoukankan      html  css  js  c++  java
  • 14-struts2的表单标签

    struts2的表单标签

    <form>-------------------<s:form>
    <input type="text">------<s:textfield>
    <input type="password">---<s:password>
    <input type="submit">-----<s:submit>
    <input type="reset">------<s:reset>

        • 1.改造form

    <s:form id="loginAction_home" name="form1" action="user_login" namespace="/" target="_parent" method="post">

        • 2.改造登录名

    <s:textfield name="logonName" value="" id="logonName" cssClass="text" cssStyle=" 160px;"/>

        • 3.改造登录密码

    <s:password name="logonPwd" id="logonPwd" cssClass="text" cssStyle=" 160px;"/>
    密码框默认不回显示.需要设置属性showPassword="true"

        • 4.<s:submit name="submit" value="登录" cssClass="buttoninput"/>
        • 5.<s:reset name="reset" value="取消" cssClass="buttoninput"/>


    注意:struts2中的表单标签,有默认的主题xhtml.如果不想要添加任何修饰,只需要将主题修改为simple.


    问题:怎样设置主题

     

        • 1.全局

    在struts.xml文件中配置一个常量
    <constant name="struts.ui.theme" value="simple"></constant>

        • 2.局部

    针对于某一个form.
    <s:form theme="simple">

        • 3.局部

    可以给任意的表单组件去指定theme属性值。

  • 相关阅读:
    python多线程http压力测试脚本
    php随机生成国内ip
    HTTP请求方式中8种请求方法(简单介绍)
    PHP函数
    jquery获取span标签下的第一个span子标签内容
    php实现数据库备份导出成sql
    php实现备份数据库
    中文繁体简体问题
    编程素养Day009
    编程素养Day008
  • 原文地址:https://www.cnblogs.com/1963942081zzx/p/6510899.html
Copyright © 2011-2022 走看看