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属性值。

  • 相关阅读:
    进程
    交换分区
    linux命令
    Linux进程
    开会
    今天的学习情况
    CentOS7.6 yum方式安装redis最新版
    Centos7 yum安装postgresql 9.5
    GitLab CI runner can't connect to tcp://localhost:2375 in kubernetes
    Server 2008 R2远程桌面授权,解决120天过期问题
  • 原文地址:https://www.cnblogs.com/1963942081zzx/p/6510899.html
Copyright © 2011-2022 走看看