Spring Framework ThemeResolver - 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 ThemeResolver class.

This code example shows how to use the following methods:setThemeName
		if (newTheme != null) { 
			ThemeResolver themeResolver = RequestContextUtils.getThemeResolver(request); 
			if (themeResolver == null) { 
				throw new IllegalStateException("No ThemeResolver found: not in a DispatcherServlet request?"); 
			} 
			themeResolver.setThemeName(request, response, newTheme); 
		} 
		// Proceed in any case. 
		return true; 
	} 
 
} 
6
CodeRank
This code example shows how to use the following methods:resolveThemeName
	 */ 
	public static Theme getTheme(HttpServletRequest request) { 
		ThemeResolver themeResolver = getThemeResolver(request); 
		ThemeSource themeSource = getThemeSource(request); 
		if (themeResolver != null && themeSource != null) { 
			String themeName = themeResolver.resolveThemeName(request); 
			return themeSource.getTheme(themeName); 
		} 
		else { 
			return null; 
		} 
	} 
 
	/** 
	 * Return a read-only {@link Map} with "input" flash attributes saved on a 
	 * previous request. 
	 * @param request the current request 
	 * @return a read-only Map, or {@code null} if not found 
	 * @see FlashMap 
	 */ 
5
CodeRank
See Code Examples for Spring Framework ThemeResolver Methods: