zoukankan      html  css  js  c++  java
  • 自定义标签TLD文件中,rtexprvalue子标签的意思

    rtexprvalue的全称是 Run-time Expression Value, 它用于表示是否能够利用JSP表达式。

    举例子:

    1、定义一个TLD文件:

    <tag>
        <name>selectDetail</name>
        <tag-class>com.nms.taglib.SelectDetail_Tag</tag-class>
        <body-content>JSP</body-content>
        <attribute>
            <name>id</name>
            <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
            <name>selectVal</name>
               <rtexprvalue>true</rtexprvalue>
        </attribute>
        <attribute>
            <name>collection</name>
            <rtexprvalue>true</rtexprvalue>
        </attribute>
    </tag>

    2、JSP文件

    <%
        User user = new User();
        user.setId(1);
        request.setAttribute("user",user);
    %>        
    <html:selectDetail id="" collection="<%="SEX" %>" selectVal="${user.id}">
    </html:selectDetail>

    使用脚本和EL表达式来获取动态的值

    如果你将rtexprvalue设置为flase,那么上面的使用会直接报错,必须这样用:

    <html:selectDetail id="" collection="SEX" selectVal="男"></html:selectDetail>  

    其实全设置为rtexprvalue全部设置为true就可以了,这样使用方便。

  • 相关阅读:
    Docker部署nginx
    解决网页在手机端适配问题
    记一次Jenkins+Docker+gitlab自动化部署vue
    Docker部署jenkins
    备案
    Jenkins插件使用--Publish Over SSH
    打开root用户ssh登陆
    gitlab配置git
    Dokcer容器内无法域名解析
    vue开发环境搭建
  • 原文地址:https://www.cnblogs.com/ouyxy/p/6722385.html
Copyright © 2011-2022 走看看