Spring EL变量列表? [英] List of Spring EL Variables?

查看:312
本文介绍了Spring EL变量列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Spring EL支持一些预定义变量

Spring EL supports a some predefined variables


  • {#systemProperties。 ...}

  • {#systemEnvironment。 ...}

  • {#request。 ...}

  • {#session。 ...}

  • {#systemProperties. ... }
  • {#systemEnvironment. ... }
  • {#request. ...}
  • {#session. ...}

前两个记录在 Spring参考:第6章Spring表达语言(SpEL)
其他两个在Spring Reference中没有提到(或者我没有找到它们。)(我发现它们在
幻灯片,以及它在 spring social 问题)。

The first two once are documented in the Spring Reference: chapter 6. Spring Expression Language (SpEL). The two others are not mentioned in the Spring Reference (or I did not found them.) (I found them in this slides, as well as its usage in spring social and this question).

所以我的问题是:是否有一个或多或少完整的预定义spring-el变量列表?

我想这些预定义变量中的一些不是由spring core本身定义的,而是通过激活某些模块(如spring-mvc)来定义的。所以我对一个或多或少常见的spring + jpa + mvc +安全应用程序

I guess that some of this predefined variables are not defined by spring core itself, but by "activating" of some modules like spring-mvc. So I am interested in the the variables that are available in a more or less common spring + jpa + mvc + security application.

推荐答案

我无法回答你的根问题,但我可能会给你一个提示。

I can not answer your root question but I may give you a hint.

在你的应用程序启动时注册了一些预定义的bean上下文但取决于您使用的上下文类型。

There are some predefined beans registered at start up of your application context but which depends on the context type you are using.

通常, systemProperties systemEnvironment 存在。在Web应用程序中加载Spring,您还将获得 servletContext contextParameters contextAttributes 。我假设, request session 也与Web应用程序上下文相关。

Commonly, systemProperties and systemEnvironment are present. Loading Spring within a web application, you will also get servletContext, contextParameters and contextAttributes. I assume, request and session are related to a web application context as well.

我在调试使用Spring 3.0.6RELEASE的应用程序时发现了这一点。一个很好的起点是SpringBeanELResolver.getValue()方法。

I discovered this during debugging of my application which uses Spring 3.0.6RELEASE. A good starting point is SpringBeanELResolver.getValue() method.

这篇关于Spring EL变量列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆