Example usage for org.springframework.web.servlet.view JstlView setUrl

List of usage examples for org.springframework.web.servlet.view JstlView setUrl

Introduction

In this page you can find the example usage for org.springframework.web.servlet.view JstlView setUrl.

Prototype

public void setUrl(@Nullable String url) 

Source Link

Document

Set the URL of the resource that this view wraps.

Usage

From source file:eu.europa.ejusticeportal.dss.demo.web.view.TemplateViewResolver.java

/**
 * Loads a JSTL view, just like the usual Use Case, but the given viewName will not be surrounded
 * by the site template; eg: for AJAX requests.
 *
 * @param viewName The body viewName.//from  w  w  w .  j a v  a2s.  com
 * @param locale The locale of the user, to be injected in the view.
 * @return The JSTL view without the surrounding template.
 * @throws Exception In case the view could not be resolved.
 */
public AbstractUrlBasedView loadViewWithoutTemplate(String viewName, Locale locale) throws Exception {
    JstlView bareView = (JstlView) resolveViewName(viewName, locale);
    // Take the template out, so we just render the page body
    String contentUrl = (String) bareView.getStaticAttributes().get(this.contentUrlParameterName);
    bareView.setUrl(contentUrl);
    return bareView;
}