Package org.codehaus.groovy.grails.web.servlet.mvc

Examples of org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequest


        HttpServletRequest request = filterInvocation.getHttpRequest();
        HttpServletResponse response = filterInvocation.getHttpResponse();
        ServletContext servletContext = ServletContextHolder.getServletContext();
        GrailsApplication application = ApplicationHolder.getApplication();

        GrailsWebRequest existingRequest = WebUtils.retrieveGrailsWebRequest();

        String requestUrl = request.getRequestURI().substring(request.getContextPath().length());

        String url = null;
        try {
            GrailsWebRequest grailsRequest = new GrailsWebRequest(request, response, servletContext);
            WebUtils.storeGrailsWebRequest(grailsRequest);

            Map<String, Object> savedParams = copyParams(grailsRequest);

            for (UrlMappingInfo mapping : _urlMappingsHolder.matchAll(requestUrl)) {
View Full Code Here


    HttpServletRequest request = filterInvocation.getHttpRequest();
    HttpServletResponse response = filterInvocation.getHttpResponse();
    ServletContext servletContext = ServletContextHolder.getServletContext();
    GrailsApplication application = ApplicationHolder.getApplication();

    GrailsWebRequest existingRequest = WebUtils.retrieveGrailsWebRequest();

    String requestUrl = request.getRequestURI().substring(request.getContextPath().length());

    String url = null;
    try {
      GrailsWebRequest grailsRequest = new GrailsWebRequest(request, response, servletContext);
      WebUtils.storeGrailsWebRequest(grailsRequest);

      Map<String, Object> savedParams = copyParams(grailsRequest);

      for (UrlMappingInfo mapping : _urlMappingsHolder.matchAll(requestUrl)) {
View Full Code Here

    scaffoldedViews.clear();
  }

  @Override
  protected View createFallbackView(String viewName) throws Exception {
    GrailsWebRequest webRequest = GrailsWebRequest.lookup();

    String[] viewNameParts = splitViewName(viewName);
    if(viewNameParts.length == 1) {
        viewName = WebUtils.addViewPrefix(viewName, webRequest.getControllerName());
        viewNameParts = splitViewName(viewName);
    }

    View v = scaffoldedViews.get(viewName);
        if (v == null) {
View Full Code Here

      }
    }
  }

  protected void initContext() {
    GrailsWebRequest requestAttributes = (GrailsWebRequest)RequestContextHolder.getRequestAttributes();
    contextHolder.get().push(new ContentCacheParameters(requestAttributes));
  }
View Full Code Here

      }
      else {
        conversionMethodName = type.getName();
      }

      GrailsWebRequest grailsRequest = (GrailsWebRequest)RequestContextHolder.getRequestAttributes();
      GrailsParameterMap params = grailsRequest.getParams();

      return getParamValue(params, conversionMethodName, name);
    }

    log.warn("Unsupported parameter type " + type + " for parameter " + name);
View Full Code Here

         *  without an initial getState() call
         * 
         *  (2) state.request may be null if GrailsControllerStateKeeper.setThreadLocalWebRequest
         *  not called
         */
        GrailsWebRequest request = (state == null) ? null : state.request;
        String actionName = (request == null) ? null : request.getActionName();
        if (actionName == null) {
            actionName = UNKNOWN_ACTION;
        }

        return actionName;
View Full Code Here

    @Before
    public void setUp() {
        super.setUp();
        request = new MockHttpServletRequest();
        response = new MockHttpServletResponse();
        mockRequest = new GrailsWebRequest(request, response, new MockServletContext());
    }
View Full Code Here

      }
    }
  }

  protected void initContext() {
    GrailsWebRequest requestAttributes = (GrailsWebRequest)RequestContextHolder.getRequestAttributes();
    contextHolder.get().push(new ContentCacheParameters(requestAttributes));
  }
View Full Code Here

      }
      else {
        conversionMethodName = type.getName();
      }

      GrailsWebRequest grailsRequest = (GrailsWebRequest)RequestContextHolder.getRequestAttributes();
      GrailsParameterMap params = grailsRequest.getParams();

      return getParamValue(params, conversionMethodName, name);
    }

    log.warn("Unsupported parameter type " + type + " for parameter " + name);
View Full Code Here

  @Override
  protected String determineUrl(final FilterInvocation filterInvocation) {
    HttpServletRequest request = filterInvocation.getHttpRequest();
    HttpServletResponse response = filterInvocation.getHttpResponse();

    GrailsWebRequest existingRequest;
    try {
      existingRequest = WebUtils.retrieveGrailsWebRequest();
    }
    catch (IllegalStateException e) {
      throw new IllegalStateException(
        "There was a problem retrieving the current GrailsWebRequest. This usually indicates a filter ordering " +
        "issue in web.xml (the 'springSecurityFilterChain' filter-mapping element must be positioned after the " +
        "'grailsWebRequest' element when using @Secured annotations) but this should be handled correctly by the " +
        "webxml plugin. Ensure that the webxml plugin is installed (it should be transitively installed as a " +
        "dependency of the spring-security-core plugin)");
    }

    String requestUrl = calculateUri(request);

    String url = null;
    try {
                        javax.servlet.ServletContext servletContext = (ServletContext)grails.util.Holders.getServletContext();
                               // servlet.ServletContext  =
      GrailsWebRequest grailsRequest = new GrailsWebRequest(request, response,servletContext );
      WebUtils.storeGrailsWebRequest(grailsRequest);

      Map<String, Object> savedParams = copyParams(grailsRequest);

      UrlMappingInfo[] urlInfos;
View Full Code Here

TOP

Related Classes of org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.