7.2.1.1 Variables and Scopes 3.0.10

See the light - agile, industrial strength, rapid web application development made easy

(Quick Reference) # 7.2.1.1 Variables and Scopes - Reference Documentation Authors: Graeme Rocher, Peter Ledbrook, Marc Palmer, Jeff Brown, Luke Daley, Burt Beckwith, Lari Hotari Version: 3.0.10 ## 7.2.1.1 Variables and Scopes Within the `<% %>` brackets you can declare variables:
    <% now = new Date() %>
and then access those variables later in the page:
    <%=now%>
Within the scope of a GSP there are a number of pre-defined variables, including: `application` - The javax.servlet.ServletContext instance `applicationContext` The Spring ApplicationContext instance `flash` - The flash object `grailsApplication` - The GrailsApplication instance `out` - The response writer for writing to the output stream `params` - The params object for retrieving request parameters `request` - The HttpServletRequest instance `response` - The HttpServletResponse instance `session` - The HttpSession instance `webRequest` - The GrailsWebRequest instance | Quick Reference (hide)