Package org.springframework.web.servlet

Examples of org.springframework.web.servlet.View


            if (cacheValue != null && (!gspReloadEnabled || !cacheValue.isExpired())) {
                return cacheValue.getDecorator();
            }
        }

        View view;
        try {
            view = viewResolver.resolveViewName(GrailsResourceUtils.appendPiecesForUri(LAYOUTS_PATH, name),
                    request.getLocale());
            // it's only possible to check that GroovyPageView exists
            if (viewMustExist && !(view instanceof AbstractGrailsView)) {
View Full Code Here


            }
            else {
                ViewResolver viewResolver = WebUtils.lookupViewResolver(getServletContext());
                if (viewResolver != null) {
                    View v;
                    try {
                        if (!response.isCommitted()) {
                            response.setContentType("text/html;charset="+defaultEncoding);

                        }
                        v = UrlMappingUtils.resolveView(request, urlMappingInfo, viewName, viewResolver);
                        v.render(Collections.EMPTY_MAP, request, response);
                    }
                    catch (Throwable e) {
//                        stackFilterer.filter(e);
                        renderDefaultResponse(response, statusCode, "Internal Server Error", e.getMessage());
                    }
View Full Code Here

  @Test
  public void testAuthorizationCodeWithFragment() throws Exception {
    endpoint.setAuthorizationCodeServices(new StubAuthorizationCodeServices());
    model.put("authorizationRequest",
        getAuthorizationRequest("foo", "http://anywhere.com#bar", null, null, Collections.singleton("code")));
    View result = endpoint.approveOrDeny(Collections.singletonMap(OAuth2Utils.USER_OAUTH_APPROVAL, "true"), model,
        sessionStatus, principal);
    assertEquals("http://anywhere.com?code=thecode#bar", ((RedirectView) result).getUrl());
  }
View Full Code Here

  public void testAuthorizationCodeWithQueryParams() throws Exception {
    endpoint.setAuthorizationCodeServices(new StubAuthorizationCodeServices());
    model.put(
        "authorizationRequest",
        getAuthorizationRequest("foo", "http://anywhere.com?foo=bar", null, null, Collections.singleton("code")));
    View result = endpoint.approveOrDeny(Collections.singletonMap(OAuth2Utils.USER_OAUTH_APPROVAL, "true"), model,
        sessionStatus, principal);
    assertEquals("http://anywhere.com?foo=bar&code=thecode", ((RedirectView) result).getUrl());
  }
View Full Code Here

  @Test
  public void testAuthorizationCodeWithTrickyState() throws Exception {
    endpoint.setAuthorizationCodeServices(new StubAuthorizationCodeServices());
    model.put("authorizationRequest",
        getAuthorizationRequest("foo", "http://anywhere.com", " =?s", null, Collections.singleton("code")));
    View result = endpoint.approveOrDeny(Collections.singletonMap(OAuth2Utils.USER_OAUTH_APPROVAL, "true"), model,
        sessionStatus, principal);
    assertEquals("http://anywhere.com?code=thecode&state=%20%3D?s", ((RedirectView) result).getUrl());
  }
View Full Code Here

    endpoint.setAuthorizationCodeServices(new StubAuthorizationCodeServices());
    model.put(
        "authorizationRequest",
        getAuthorizationRequest("foo", "http://anywhere.com?foo=bar&bar=foo", null, null,
            Collections.singleton("code")));
    View result = endpoint.approveOrDeny(Collections.singletonMap(OAuth2Utils.USER_OAUTH_APPROVAL, "true"), model,
        sessionStatus, principal);
    assertEquals("http://anywhere.com?foo=bar&bar=foo&code=thecode", ((RedirectView) result).getUrl());
  }
View Full Code Here

    endpoint.setAuthorizationCodeServices(new StubAuthorizationCodeServices());
    model.put(
        "authorizationRequest",
        getAuthorizationRequest("foo", "http://anywhere.com?foo=b =&bar=f $", null, null,
            Collections.singleton("code")));
    View result = endpoint.approveOrDeny(Collections.singletonMap(OAuth2Utils.USER_OAUTH_APPROVAL, "true"), model,
        sessionStatus, principal);
    assertEquals("http://anywhere.com?foo=b%20%3D&bar=f%20$&code=thecode", ((RedirectView) result).getUrl());
  }
View Full Code Here

        Collections.singleton("code"));
    request.setApproved(true);
    Map<String, String> approvalParameters = new HashMap<String, String>();
    approvalParameters.put("user_oauth_approval", "true");
    model.put("authorizationRequest", request);
    View result = endpoint.approveOrDeny(approvalParameters, model, sessionStatus, principal);
    assertTrue("Wrong view: " + result, ((RedirectView) result).getUrl().startsWith("http://anywhere.com"));
  }
View Full Code Here

  public void testApprovalDenied() throws Exception {
    model.put("authorizationRequest",
        getAuthorizationRequest("foo", "http://anywhere.com", null, null, Collections.singleton("code")));
    Map<String, String> approvalParameters = new HashMap<String, String>();
    approvalParameters.put("user_oauth_approval", "false");
    View result = endpoint.approveOrDeny(approvalParameters, model, sessionStatus, principal);
    String url = ((RedirectView) result).getUrl();
    assertTrue("Wrong view: " + result, url.startsWith("http://anywhere.com"));
    assertTrue("Wrong view: " + result, url.contains("error=access_denied"));
  }
View Full Code Here

    logger.debug("query = {}", queryStr);

    if (queryStr != null) {
      Query query = getQuery(repository, repositoryCon, queryStr, request, response);

      View view;
      Object queryResult;
      FileFormatServiceRegistry<? extends FileFormat, ?> registry;

      if (query instanceof TupleQuery) {
        TupleQuery tQuery = (TupleQuery)query;
View Full Code Here

TOP

Related Classes of org.springframework.web.servlet.View

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.