Chinese GSP Reference

GSP 参考

实例

参考

  • 可用变量 
  • 页面属性 
  • 调用标签和处理属性 
  • 内嵌的Groovy 脚本

实例

参考

可用变量

这里有多个可以用于所有页面变量(全局变量). 它们与Java Server Pages (JSP)中那些变量是相似的.

  • application
  • flash
  • out
  • params
  • request
  • response
  • session

application

Since: the beginning

该变量参考servletContext, 它能够有助于你访问跨越整个应用程序的共享属性(not per-request).

例子:

假设你已经通过你的ApplicationBootStap的init()闭包设置了一个"versionNumber"属性在你的servletContext中, 那么,你可以按如下方式在任意页面中来显示它:

<div>
Application version ${application.getAttribute('versionNumber')}
</div>

flash

out

params

request

response

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.