Java Doc for AbstractView.java in  » J2EE » spring-framework-2.0.6 » org » springframework » web » servlet » view » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » spring framework 2.0.6 » org.springframework.web.servlet.view 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.springframework.web.context.support.WebApplicationObjectSupport
   org.springframework.web.servlet.view.AbstractView

All known Subclasses:   org.springframework.web.servlet.view.document.AbstractJExcelView,  org.springframework.web.servlet.view.AbstractUrlBasedView,  org.springframework.web.servlet.view.document.AbstractPdfView,  org.springframework.web.servlet.view.xslt.AbstractXsltView,  org.springframework.web.servlet.view.document.AbstractExcelView,
AbstractView
abstract public class AbstractView extends WebApplicationObjectSupport implements View,BeanNameAware(Code)
Abstract base class for org.springframework.web.servlet.View implementations. Subclasses should be JavaBeans, to allow for convenient configuration as Spring-managed bean instances.

Provides support for static attributes, to be made available to the view, with a variety of ways to specify them. Static attributes will be merged with the given dynamic attributes (the model that the controller returned) for each render operation.

Extends WebApplicationObjectSupport , which will be helpful to some views. Subclasses just need to implement the actual rendering.
author:
   Rod Johnson
author:
   Juergen Hoeller
See Also:   AbstractView.setAttributes
See Also:   AbstractView.setAttributesMap
See Also:   AbstractView.renderMergedOutputModel



Field Summary
final public static  StringDEFAULT_CONTENT_TYPE
     Default content type.


Method Summary
public  voidaddStaticAttribute(String name, Object value)
     Add static data to this view, exposed in each view.
protected  RequestContextcreateRequestContext(HttpServletRequest request, Map model)
     Create a RequestContext to expose under the specified attribute name.

Default implementation creates a standard RequestContext instance for the given request and model.

protected  voidexposeModelAsRequestAttributes(Map model, HttpServletRequest request)
     Expose the model objects in the given map as request attributes.
public  MapgetAttributesMap()
     Allow Map access to the static attributes of this view, with the option to add or override specific entries.

Useful for specifying entries directly, for example via "attributesMap[myKey]".

public  StringgetBeanName()
     Return the view's name.
public  StringgetContentType()
     Return the content type for this view.
public  StringgetRequestContextAttribute()
     Return the name of the RequestContext attribute, if any.
public  MapgetStaticAttributes()
     Return the static attributes for this view.
public  voidrender(Map model, HttpServletRequest request, HttpServletResponse response)
     Prepares the view given the specified model, merging it with static attributes and a RequestContext attribute, if necessary.
abstract protected  voidrenderMergedOutputModel(Map model, HttpServletRequest request, HttpServletResponse response)
     Subclasses must implement this method to actually render the view.
public  voidsetAttributes(Properties attributes)
     Set static attributes for this view from a java.util.Properties object.

This is the most convenient way to set static attributes.

public  voidsetAttributesCSV(String propString)
     Set static attributes as a CSV string.
public  voidsetAttributesMap(Map attributes)
     Set static attributes for this view from a Map.
public  voidsetBeanName(String beanName)
     Set the view's name.
public  voidsetContentType(String contentType)
     Set the content type for this view. Default is "text/html;charset=ISO-8859-1".

May be ignored by subclasses if the view itself is assumed to set the content type, e.g.

public  voidsetRequestContextAttribute(String requestContextAttribute)
     Set the name of the RequestContext attribute for this view.
public  StringtoString()
    

Field Detail
DEFAULT_CONTENT_TYPE
final public static String DEFAULT_CONTENT_TYPE(Code)
Default content type. Overridable as bean property.





Method Detail
addStaticAttribute
public void addStaticAttribute(String name, Object value)(Code)
Add static data to this view, exposed in each view.

Must be invoked before any calls to render.
Parameters:
  name - the name of the attribute to expose
Parameters:
  value - the attribute value to expose
See Also:   AbstractView.render




createRequestContext
protected RequestContext createRequestContext(HttpServletRequest request, Map model)(Code)
Create a RequestContext to expose under the specified attribute name.

Default implementation creates a standard RequestContext instance for the given request and model. Can be overridden in subclasses for custom instances.
Parameters:
  request - current HTTP request
Parameters:
  model - combined output Map (never null),with dynamic values taking precedence over static attributes the RequestContext instance
See Also:   AbstractView.setRequestContextAttribute
See Also:   org.springframework.web.servlet.support.RequestContext




exposeModelAsRequestAttributes
protected void exposeModelAsRequestAttributes(Map model, HttpServletRequest request) throws Exception(Code)
Expose the model objects in the given map as request attributes. Names will be taken from the model Map. This method is suitable for all resources reachable by javax.servlet.RequestDispatcher .
Parameters:
  model - Map of model objects to expose
Parameters:
  request - current HTTP request



getAttributesMap
public Map getAttributesMap()(Code)
Allow Map access to the static attributes of this view, with the option to add or override specific entries.

Useful for specifying entries directly, for example via "attributesMap[myKey]". This is particularly useful for adding or overriding entries in child view definitions.




getBeanName
public String getBeanName()(Code)
Return the view's name. Should never be null, if the view was correctly configured.



getContentType
public String getContentType()(Code)
Return the content type for this view.



getRequestContextAttribute
public String getRequestContextAttribute()(Code)
Return the name of the RequestContext attribute, if any.



getStaticAttributes
public Map getStaticAttributes()(Code)
Return the static attributes for this view. Handy for testing.

Returns an unmodifiable Map, as this is not intended for manipulating the Map but rather just for checking the contents. the static attributes in this view




render
public void render(Map model, HttpServletRequest request, HttpServletResponse response) throws Exception(Code)
Prepares the view given the specified model, merging it with static attributes and a RequestContext attribute, if necessary. Delegates to renderMergedOutputModel for the actual rendering.
See Also:   AbstractView.renderMergedOutputModel



renderMergedOutputModel
abstract protected void renderMergedOutputModel(Map model, HttpServletRequest request, HttpServletResponse response) throws Exception(Code)
Subclasses must implement this method to actually render the view.

The first step will be preparing the request: In the JSP case, this would mean setting model objects as request attributes. The second step will be the actual rendering of the view, for example including the JSP via a RequestDispatcher.
Parameters:
  model - combined output Map (never null),with dynamic values taking precedence over static attributes
Parameters:
  request - current HTTP request
Parameters:
  response - current HTTP response
throws:
  Exception - if rendering failed




setAttributes
public void setAttributes(Properties attributes)(Code)
Set static attributes for this view from a java.util.Properties object.

This is the most convenient way to set static attributes. Note that static attributes can be overridden by dynamic attributes, if a value with the same name is included in the model.

Can be populated with a String "value" (parsed via PropertiesEditor) or a "props" element in XML bean definitions.
See Also:   org.springframework.beans.propertyeditors.PropertiesEditor




setAttributesCSV
public void setAttributesCSV(String propString) throws IllegalArgumentException(Code)
Set static attributes as a CSV string. Format is: attname0={value1},attname1={value1}



setAttributesMap
public void setAttributesMap(Map attributes)(Code)
Set static attributes for this view from a Map. This allows to set any kind of attribute values, for example bean references.

Can be populated with a "map" or "props" element in XML bean definitions.
Parameters:
  attributes - Map with name Strings as keys and attribute objects as values




setBeanName
public void setBeanName(String beanName)(Code)
Set the view's name. Helpful for traceability.

Framework code must call this when constructing views.




setContentType
public void setContentType(String contentType)(Code)
Set the content type for this view. Default is "text/html;charset=ISO-8859-1".

May be ignored by subclasses if the view itself is assumed to set the content type, e.g. in case of JSPs.




setRequestContextAttribute
public void setRequestContextAttribute(String requestContextAttribute)(Code)
Set the name of the RequestContext attribute for this view. Default is none.



toString
public String toString()(Code)



Methods inherited from org.springframework.web.context.support.WebApplicationObjectSupport
final protected ServletContext getServletContext() throws IllegalStateException(Code)(Java Doc)
final protected File getTempDir() throws IllegalStateException(Code)(Java Doc)
final protected WebApplicationContext getWebApplicationContext() throws IllegalStateException(Code)(Java Doc)
protected boolean isContextRequired()(Code)(Java Doc)
final public void setServletContext(ServletContext servletContext)(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.