zoukankan      html  css  js  c++  java
  • spring表达式语言

    使用文本表达式
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans.xsd">
    <!--创建员工的对象-->
    <bean id="emp" class="com.aaa.spring.entity.Emp">
    <property name="empno" value="#{7369}"></property>
    <property name="ename" value="#{'张三'}"></property>
    <property name="age" value="#{10E+3}"></property>
    </bean>
    </beans>
    属性访问的表达式
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans.xsd">
    <!--创建部门对象-->
    <bean id="dept" class="com.aaa.spring.entity.Dept">
    <property name="deptno" value="10"></property>
    <property name="dname" value="销售部"></property>
    <property name="loc" value="郑州"></property>
    </bean>
    <!--创建员工的对象-->
    <bean id="emp" class="com.aaa.spring.entity.Emp">
    <property name="empno" value="#{7369}"></property>
    <property name="ename" value="#{'张三'}"></property>
    <property name="age" value="#{10E+3}"></property>
    <!--通过表达式语言访问别的对象的属性-->
    <property name="dname" value="#{dept.dname}"></property>
    </bean>
    </beans>
    方法和常量访问的表达式
    安全导航表达式
    在表达式中操作集合
     

  • 相关阅读:
    2013414
    Juqery Html(),append()等方法的Bug
    UpdatePanel 与 jQuery
    (C#)方法参数关键字:ref、out、params详解
    ASP.NET MVC 3 RC2 版本的一些新特性及AllowHtml属性Bug解决办法
    [hystar整理]Entity Framework 教程 转
    SQL 中in exists 和临时表用法
    ASP.NET 用户控件自定义属性、方法、事件
    SQL选择不重复记录
    sql over 用法
  • 原文地址:https://www.cnblogs.com/duguangming/p/10922737.html
Copyright © 2011-2022 走看看