Exemplo n.º 1
0
 public GrailsWebRequest(
     HttpServletRequest request,
     HttpServletResponse response,
     GrailsApplicationAttributes attributes) {
   super(request, response);
   this.attributes = attributes;
   this.applicationContext = attributes.getApplicationContext();
   inheritEncodingStateRegistry();
 }
Exemplo n.º 2
0
 public GrailsWebRequest(
     HttpServletRequest request, HttpServletResponse response, ServletContext servletContext) {
   super(request, response);
   try {
     attributes = grailsApplicationAttributesConstructor.newInstance(servletContext);
     this.applicationContext = attributes.getApplicationContext();
   } catch (Exception e) {
     ReflectionUtils.rethrowRuntimeException(e);
   }
   inheritEncodingStateRegistry();
 }
Exemplo n.º 3
0
 /** @return the out */
 public Writer getOut() {
   Writer out = attributes.getOut(getCurrentRequest());
   if (out == null) {
     try {
       return getCurrentResponse().getWriter();
     } catch (IOException e) {
       throw new ControllerExecutionException(
           "Error retrieving response writer: " + e.getMessage(), e);
     }
   }
   return out;
 }
Exemplo n.º 4
0
 public void setFilteringCodec(String codecName) {
   filteringEncoder =
       codecName != null
           ? CodecLookupHelper.lookupEncoder(attributes.getGrailsApplication(), codecName)
           : null;
 }
Exemplo n.º 5
0
 /** @return The FlashScope instance for the current request */
 public FlashScope getFlashScope() {
   return attributes.getFlashScope(getRequest());
 }
Exemplo n.º 6
0
 /** @return The ServletContext instance */
 public ServletContext getServletContext() {
   return attributes.getServletContext();
 }
Exemplo n.º 7
0
 /** @param out the out to set */
 public void setOut(Writer out) {
   attributes.setOut(getCurrentRequest(), out);
 }