velocity获取session中的属性值

1、spring-servlet.xml配置如下:

<bean id="viewResolver" class="com.vinuxpay.framework.core.web.springmvc.VinuxpayVelocityViewResolver">
            <property name="prefix" value="/" />
            <property name="suffix" value=".vm" />
            <property name="exposeSpringMacroHelpers" value="true" />
            <property name="exposeSessionAttributes" value="true" />
            <property name="exposeRequestAttributes" value="true" />
            <property name="requestContextAttribute" value="rc" />
            <property name="contentType" value="text/html;charset=UTF-8" />
    </bean>

2、velocity页面获取

$session.getAttribute("CHERRYUSER").LOGIN_NAME

时间: 2024-08-29 23:33:19

velocity获取session中的属性值的相关文章

JS或jsp获取Session中保存的值

JS是不能读取Session中的值的 . session是服务器对象, javascript是客户端脚本,你能做的操作就是把这个值用 <%=%>输出到页面的javascript中参与运算,而无法直接用js调用的 方法: 你可以做一个AJAX来请求 服务器, 返回session中的值 . 当然你也可以在JSP中使用<%=%>这种东西来获取session中的值,例如: <script language="JavaScript"> var myName=&

html页面通过ajax请求获取session中的值

在利用springboot进行web开发时,遇到这样一个问题:html如何获取session中的值,实现用户登录系统后首页展示xx欢迎您. 也就是需要实现html通过ajax请求获取session中的值. 1.登录页面 <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <meta charset="utf-8"> <meta http-equiv=&quo

webBrowser控件中获取元素 的class 属性值

html 代码如下: <TR id="t030006" class="sr plus selected"> <TD><INPUT id=cvrgNo030006 value=030006 readOnly CHECKED type=checkbox jQuery1456994811776="96"></TD> <TD>车辆损失险 </TD> <TD style=&quo

jsp页面使用el 按key获取map中的对应值

jsp页面使用el 按key获取map中的对应值 转自:<jsp页面使用el 按key获取map中的对应值>地址:http://blog.csdn.net/baple/article/details/18517359 jsp页面中的代码: <script type="text/javascript"> var msgTip = "${msgs['loginError']}"; alert(msgTip); </script> 注意

获取JSON对象的属性值

1.问题背景 有一个json对象,其中有键值对,那怎样获取json对象中属性值 2.实现源码 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">

orm获取关联表里的属性值

ORM——关系对象模型 laravel中的Eloquent ORM用于和数据表互动,其中每个数据库表会和一个对应的「模型」互动,想要了解请查看官方文档或自行百度.获取关联表里的属性值代码如下: /** * [getContactAttribute 获取卖家联系人] */ public function getContactAttribute() { return $this->hasOne('App\Http\Models\Supplier', 'SupplierId', 'SupplierId

将source类中的属性值赋给target类中对应的属性

/** * 对象的属性值拷贝 * <p> * 将source对象中的属性值赋值到target对象中的属性,属性名一样,类型一样 * <p> * example: * <p> * source: * <p> * String name; * String address; * Integer age; * Date birthday; * <p> * target: * String name; * String address; * String

javascript 获取样式表里的属性值 currentStyle 和 getComputedStyle 的使用

很多时候我们要获取 CSS 样式表里面的值(非行间样式),而获取行间样式的属性值那么这用 obj.style.attr 就能获取得到,那么怎么样才能获取到CSS样式表里面的值呢,那么就要请出我们的主角 currentStyle 和 getComputedStyle ,简要的介绍一下他们,再封装一个函数来兼容各个浏览器. 介绍: currentStyle :这个属性是 IE 浏览器上使用的. getComputedStyle :这个方法是 搞基 浏览器上使用的. 封装: //这里的 obj 参数指

jquery获取当前选项的属性值a

<!DOCTYPE HTML> <html lang="en-US"> <head> <meta charset="UTF-8"> <title></title> <script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/1.6.4/jquery.js"><