6.2.1.1 变量和作用域 - Reference Documentation
Authors: Graeme Rocher, Peter Ledbrook, Marc Palmer, Jeff Brown, Luke Daley, Burt Beckwith
Version: null
6.2.1.1 变量和作用域
Within the and then access those variables later in the page:Within the scope of a GSP there are a number of pre-defined variables, including:
在<% %> brackets you can declare variables:<% now = new Date() %><%=now%>application- The javax.servlet.ServletContext instanceapplicationContextThe Spring ApplicationContext instanceflash- The flash objectgrailsApplication- The GrailsApplication instanceout- The response writer for writing to the output streamparams- The params object for retrieving request parametersrequest- The HttpServletRequest instanceresponse- The HttpServletResponse instancesession- The HttpSession instancewebRequest- The GrailsWebRequest instance
<% %>内,你可以声明变量:<% now = new Date() %><%=now%>application- javax.servlet.ServletContext实例applicationContextSpring的ApplicationContext实例flash- flash对象grailsApplication- GrailsApplication实例out- 响应输出流输出器params- params对象,用于接收请求参数request- HttpServletRequest实例response- HttpServletResponse实例session- HttpSession实例webRequest- GrailsWebRequest实例

