zoukankan      html  css  js  c++  java
  • Struts2 ui标签

     命名空间:在form  action=”命名空间名/action”

    struts2 ui标签库

    引包: <%@taglib uri="/struts-tags"prefix="s" %>  
    
    <%@taglib uri="/struts-tags"prefix="s" %>
       <s:form action="login"method="post" name="frm"id="frm" theme="xhtml">
     
             <s:textfield name="user.uname"label="username"></s:textfield>
             <s:password name="user.pwd"label="password"></s:password>
             <s:radio list="{'男生','女生','男人','女人','男子','女子'}" name="sex"label="性别"></s:radio>
             <s:checkboxlist list="{'vrey','good','bad','坏','孬','好'}" name="hobby" label="爱好"></s:checkboxlist>
             <s:select list="{'北京','南京','东京'}" name="city" label="城市"></s:select>
             <s:textarea rows="5"clos="20" name="info"label="自己介绍"></s:textarea>
             <s:submit label="登陆"></s:submit>
         </s:form>
     
           ognl:
    <s:property value="#application.user.pwd"/>

    struts.xml通配符使用:

    struts.xml:

    <action name="user_*"class="com.bjsxt.action.LoginAction"     method="{1}">

               <result name="{1}">/ognl.jsp</result>

           </action>

    .jsp:

    <form action="user_zzu">

           <input type="submit"value="zzu">

        </form>

    .java:

    public String zzu()  {

            user.setUname("zzdx");

            user.setPwd("yyuy");

            return "zzu";

        } 

  • 相关阅读:
    MOP tricks
    DTLZ
    箱型图Box
    IDEA代码折叠
    IDEA快捷键无法使用
    [转].gitignore文件不起作用的解决方案
    你必须知道的EF知识和经验
    采用MiniProfiler监控EF与.NET MVC项目
    EF使用CodeFirst方式生成数据库&技巧经验
    EF查询之性能优化技巧
  • 原文地址:https://www.cnblogs.com/chenglc/p/6923187.html
Copyright © 2011-2022 走看看