2

There are some variables and closures in groovlet like request, response, out, forward, redirect...

Is it possible to bind my own variables and closures to groovlet automatically?

I want this feature for ${escapeHtml(params.value)} like things.

Pop
  • 12,135
  • 5
  • 55
  • 68
KwonNam
  • 686
  • 1
  • 8
  • 19

1 Answers1

3

GroovyServlet provides a hook for doing exactly this: setVariables. Create a subclass of GroovyServlet that overrides this method and populate the ServletBinding with whatever you want.

ataylor
  • 64,891
  • 24
  • 161
  • 189