Spring Framework WebApplicationObjectSupport - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework WebApplicationObjectSupport class.

This code example shows how to use the following methods:getUrl, exposeModelAsRequestAttributes, getBeanName, getServletContext
	/** 
	 * Renders output using Tiles. 
	 */ 
	protected void renderMergedOutputModel(Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) throws Exception { 
 
		ServletContext servletContext = getServletContext(); 
		@SuppressWarnings("deprecation") 
		TilesContainer container = TilesAccess.getContainer(servletContext); 
		if (container == null) { 
			throw new ServletException("Tiles container is not initialized. " + "Have you added a TilesConfigurer to your web application context?"); 
		} 
 
		exposeModelAsRequestAttributes(model, request); 
 
		dynamicTilesViewProcessor.renderMergedOutputModel(getBeanName(), getUrl(), servletContext, request, response, container); 
	} 
 
} 
6
CodeRank
This code example shows how to use the following methods:
 
public abstract class AbstractAjaxHandler extends WebApplicationObjectSupport implements AjaxHandler { 
 
	private AbstractAjaxHandler delegate; 
 
	public AbstractAjaxHandler(AbstractAjaxHandler delegate) { 
		this.delegate = delegate; 
	} 
 
	public final boolean isAjaxRequest(HttpServletRequest request, HttpServletResponse response) { 
		if (isAjaxRequestInternal(request, response)) { 
			return true; 
		} 
		if (delegate != null) { 
			return delegate.isAjaxRequest(request, response); 
		} 
		return false; 
	} 
 
	public final void sendAjaxRedirect(String targetUrl, HttpServletRequest request, HttpServletResponse response, 
5
CodeRank
This code example shows how to use the following methods:
 * 
 * @since 2.2.0 
 * @author Rossen Stoyanchev 
 * @see ResourceHandler 
 */ 
public class JsfResourceRequestHandler extends WebApplicationObjectSupport implements HttpRequestHandler { 
 
	public void handleRequest(HttpServletRequest request, HttpServletResponse response) 
			throws ServletException, IOException { 
 
		FacesContextHelper helper = new FacesContextHelper(); 
		try { 
			FacesContext facesContext = helper.getFacesContext(getServletContext(), request, response); 
			ResourceHandler resourceHandler = facesContext.getApplication().getResourceHandler(); 
			resourceHandler.handleResourceRequest(facesContext); 
		} finally { 
			helper.releaseIfNecessary(); 
		} 
	} 
 
5
CodeRank
This code example shows how to use the following methods:getCurrentInstance, isInstalled
	 * @param externalContext the JSF external context 
	 * @param application the newly created application 
	 */ 
	public static void postConstructApplicationEvent(ExternalContext externalContext, Application application) { 
		externalContext.getApplicationMap().put(APPLICATION_ATTRIBUTE, application); 
		if (isInstalled(externalContext)) { 
			// We have already loaded, we need to fire an event 
			getCurrentInstance(externalContext).publishPostConstructApplicationEvent(application); 
		} 
	} 
} 
5
CodeRank
This code example shows how to use the following methods:
/** 
 * {@link HttpRequestHandler} that delegate JSF resource requests to the {@link ResourceHandler}. 
 *  
 * @author Phillip Webb 
 */ 
public class FacesResourceRequestHandler extends WebApplicationObjectSupport implements HttpRequestHandler { 
 
	public void handleRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, 
			IOException { 
		SpringFacesContext springFacesContext = SpringFacesContext.getCurrentInstance(false); 
		if (springFacesContext != null) { 
			FacesContext facesContext = springFacesContext.getFacesContext(); 
			try { 
				ResourceHandler resourceHandler = facesContext.getApplication().getResourceHandler(); 
				resourceHandler.handleResourceRequest(facesContext); 
			} finally { 
				facesContext.release(); 
			} 
		} 
	} 
5
CodeRank
This code example shows how to use the following methods:
 * type. 
 *  
 * @author Phillip Webb 
 * @see FacesConverterId 
 */ 
public class GenericFacesConverter extends WebApplicationObjectSupport implements ConditionalGenericConverter { 
 
	public Set<ConvertiblePair> getConvertibleTypes() { 
		return Collections.singleton(new ConvertiblePair(String.class, Object.class)); 
	} 
 
	public boolean matches(TypeDescriptor sourceType, TypeDescriptor targetType) { 
		if (SpringFacesContext.getCurrentInstance() == null) { 
			return false; 
		} 
		if (targetType.getAnnotation(FacesConverterId.class) != null) { 
			return true; 
		} 
		FacesContext facesContext = SpringFacesContext.getCurrentInstance().getFacesContext(); 
		Application application = facesContext.getApplication(); 
5
CodeRank
This code example shows how to use the following methods:
 * User: mati 
 * Date: 01/11/2013 
 * Time: 18:36 
 */ 
@Deprecated 
public class WebApplicationContextDataResolver extends WebApplicationObjectSupport implements RuntimeDataResolver { 
 
    private String prefix = "_web.app.context."; 
 
    @Override 
    public void resolveData(final HttpServletRequest request, final HttpServletResponse response, final Map<String, ? extends Object> model, final SoyMapData root) { 
        final WebApplicationContext context = getWebApplicationContext(); 
        if (context.getApplicationName() != null) { 
            root.put(prefix + "applicationName", context.getApplicationName()); 
        } 
        if (context.getDisplayName() != null) { 
            root.put(prefix + "displayName", context.getDisplayName()); 
        } 
        root.put(prefix + "startUp", DateFormat.getDateTimeInstance().format(new Date(context.getStartupDate()))); 
        if (context.getId() != null) { 
4
CodeRank
This code example shows how to use the following methods:
/** 
 *  
 * @author Lawrence Cheung 
 * 
 */ 
public abstract class AbstractFormController extends WebApplicationObjectSupport { 
 
    protected abstract <T> FormFactory<T> createFormFactory(final Class<T> formObjectClass); 
     
    protected <T> FormFactory<T> createFormFactory(final Class<T> formObjectClass, Validator ... validator){ 
         
        final FormFactory<T> formFactory = createFormFactory(formObjectClass); 
         
        formFactory.setValidators(Arrays.asList(validator)); 
         
        return formFactory; 
         
    } 
     
} 
4
CodeRank
This code example shows how to use the following methods:
     * <p> 
     *   Creates a new instance of <tt>ThymeleafView</tt>. 
     * </p> 
     */ 
	protected AbstractThymeleafView() { 
	    super(); 
	} 
 
 
	/** 
	 * <p> 
	 *   Creates a new instance of <tt>ThymeleafView</tt>, specifying the 
	 *   template name. 
	 * </p> 
	 *  
	 * @param templateName the template name. 
	 */ 
	protected AbstractThymeleafView(final String templateName) { 
	    super(); 
		this.templateName = templateName; 
2
CodeRank
This code example shows how to use the following methods:
     * <p> 
     *   Creates a new instance of <tt>ThymeleafView</tt>. 
     * </p> 
     */ 
	protected AbstractThymeleafView() { 
	    super(); 
	} 
 
 
	/** 
	 * <p> 
	 *   Creates a new instance of <tt>ThymeleafView</tt>, specifying the 
	 *   template name. 
	 * </p> 
	 *  
	 * @param templateName the template name. 
	 */ 
	protected AbstractThymeleafView(final String templateName) { 
	    super(); 
		this.templateName = templateName; 
2
CodeRank