コード例 #1
0
 public GrailsWebRequest(
     HttpServletRequest request,
     HttpServletResponse response,
     GrailsApplicationAttributes attributes) {
   super(request, response);
   this.attributes = attributes;
   this.applicationContext = attributes.getApplicationContext();
   inheritEncodingStateRegistry();
 }
コード例 #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();
 }
コード例 #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;
 }
コード例 #4
0
 public void setFilteringCodec(String codecName) {
   filteringEncoder =
       codecName != null
           ? CodecLookupHelper.lookupEncoder(attributes.getGrailsApplication(), codecName)
           : null;
 }
コード例 #5
0
 /** @return The FlashScope instance for the current request */
 public FlashScope getFlashScope() {
   return attributes.getFlashScope(getRequest());
 }
コード例 #6
0
 /** @return The ServletContext instance */
 public ServletContext getServletContext() {
   return attributes.getServletContext();
 }
コード例 #7
0
 /** @param out the out to set */
 public void setOut(Writer out) {
   attributes.setOut(getCurrentRequest(), out);
 }