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

This code example shows how to use the following methods:setUrl, setContentType, setAttributesMap, setExposeContextBeansAsAttributes, setExposePathVariables

8
CodeRank
This code example shows how to use the following methods:setUrl, setContentType, setAttributesMap, setExposeContextBeansAsAttributes, setExposePathVariables

8
CodeRank
This code example shows how to use the following methods:setUrl, setContentType, setAttributesMap, setExposeContextBeansAsAttributes, setExposePathVariables

7
CodeRank
This code example shows how to use the following methods:setUrl, setContentType, setAttributesMap, setExposeContextBeansAsAttributes, setExposePathVariables

7
CodeRank
This code example shows how to use the following methods:setContentType
 
public class Dom4jView extends AbstractView { 
 
	private Document document; 
 
	public Dom4jView(Document document) { 
		setContentType("text/xml"); 
		this.document = document; 
	} 
	 
	protected void renderMergedOutputModel(Map<String, Object> model, 
			HttpServletRequest request, HttpServletResponse response) 
			throws Exception { 
		 
		response.setContentType(getContentType()); 
		XMLWriter xmlWriter = new XMLWriter(response.getWriter()); 
		xmlWriter.write(document); 
	} 
 
} 
6
CodeRank
This code example shows how to use the following methods:setContentType
	 
	private JsonConfig jsonConfig = new JsonConfig(); 
	 
	private boolean useMergedOutputModel = true; 
	 
	public JsonView() { 
		setContentType(DEFAULT_CONTENT_TYPE); 
	} 
	 
	public JsonView(Object obj) { 
		this(); 
		jsonModel = obj; 
		useMergedOutputModel = false; 
	} 
	 
	public void setHeaderName(String headerName) { 
		this.headerName = headerName; 
	} 
 
	public void setCharacterEncoding(String characterEncoding) { 
5
CodeRank
This code example shows how to use the following methods:setContentType
    private String baseUrl; 
     
    /** 
     * This constructor sets the appropriate content type "application/xml; charset=UTF-8". 
     */ 
    public AbstractRssView() { 
        setContentType("application/xml; charset=UTF-8"); 
        setDefaultFeedType(DEFAULT_FEED_TYPE); 
    } 
     
        /* (non-Javadoc) 
         * @see org.springframework.web.servlet.view.AbstractView#renderMergedOutputModel(java.util.Map, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) 
         */ 
    protected final void renderMergedOutputModel(Map model, HttpServletRequest request, HttpServletResponse response) 
    throws Exception { 
        setBaseUrl(request); 
         
        SyndFeed feed = newSyndFeed(); 
        buildFeed(model,request,response,feed); 
         
5
CodeRank
This code example shows how to use the following methods:setContentType
import flexjson.JSONSerializer; 
 
 
public class AjaxView extends AbstractView{ 
	 
	public AjaxView() { 
		setContentType("text/plain; charset=utf-8"); 
	} 
	 
	@SuppressWarnings("rawtypes") 
	@Override 
	protected void renderMergedOutputModel(Map map, HttpServletRequest request, HttpServletResponse response) throws Exception { 
		 
		JSONSerializer serializer = new JSONSerializer();          
		String jsonString = serializer.serialize(map);       
	 
		response.getOutputStream().write( jsonString.getBytes() ); 
	} 
 
} 
5
CodeRank
This code example shows how to use the following methods:
/** 
 * Base class for views that serialize {@link DataTable} objects 
 *  
 * @author Eric Dalquist 
 */ 
public abstract class AbstractGoogleDataTableView extends AbstractView { 
    public static final String DATA_TABLE_MODEL_ATTRIBUTE = "dataTable"; 
 
    @Override 
    protected final void renderMergedOutputModel(Map<String, Object> model, 
            HttpServletRequest request, HttpServletResponse response) 
            throws Exception { 
 
        try { 
            DataTable data = (DataTable) model.get(DATA_TABLE_MODEL_ATTRIBUTE); 
            if (data == null) { 
                for (final Object value : model.values()) { 
                    if (value instanceof DataTable) { 
                        if (data == null) { 
                            data = (DataTable) value; 
5
CodeRank
This code example shows how to use the following methods:setContentType
 
public class JsonView extends AbstractView{ 
 
	protected static final String DEFAULT_ENCODING = "utf-8"; 
 
	public JsonView() { 
		setContentType("text/plain; charset=utf-8"); 
	} 
	 
	@SuppressWarnings({ "rawtypes", "unused" }) 
	protected void renderMergedOutputModel(Map map, HttpServletRequest request, HttpServletResponse response) throws Exception { 
		// param 으로 정의된 객체만 꺼내온다. 		 
		Object localObject = map.get("param"); 
		 
		JSONObject localJSONObject = null; 
		if (localObject != null) { 
			localJSONObject = JSONObject.fromObject(localObject); 
		} else {	 
			Iterator localIterator = map.keySet().iterator(); 
			String str = null; 
5
CodeRank
See Code Examples for Spring Framework AbstractView Methods: