Java Doc for ModelAndView.java in  » J2EE » spring-framework-2.0.6 » org » springframework » web » servlet » 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 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.springframework.web.servlet.ModelAndView

ModelAndView
public class ModelAndView (Code)
Holder for both Model and View in the web MVC framework. Note that these are entirely distinct. This class merely holds both to make it possible for a controller to return both model and view in a single return value.

Represents a model and view returned by a handler, to be resolved by a DispatcherServlet. The view can take the form of a String view name which will need to be resolved by a ViewResolver object; alternatively a View object can be specified directly. The model is a Map, allowing the use of multiple objects keyed by name.
author:
   Rod Johnson
author:
   Juergen Hoeller
author:
   Rob Harrop
See Also:   DispatcherServlet
See Also:   ViewResolver
See Also:   HandlerAdapter.handle
See Also:   org.springframework.web.servlet.mvc.Controller.handleRequest




Constructor Summary
public  ModelAndView()
     Default constructor for bean-style usage: populating bean properties instead of passing in constructor arguments.
public  ModelAndView(String viewName)
     Convenient constructor when there is no model data to expose.
public  ModelAndView(View view)
     Convenient constructor when there is no model data to expose.
public  ModelAndView(String viewName, Map model)
     Creates new ModelAndView given a view name and a model.
Parameters:
  viewName - name of the View to render, to be resolvedby the DispatcherServlet's ViewResolver
Parameters:
  model - Map of model names (Strings) to model objects(Objects).
public  ModelAndView(View view, Map model)
     Creates new ModelAndView given a View object and a model. Note: the supplied model data is copied into the internal storage of this class.
public  ModelAndView(String viewName, String modelName, Object modelObject)
     Convenient constructor to take a single model object.
public  ModelAndView(View view, String modelName, Object modelObject)
     Convenient constructor to take a single model object.

Method Summary
public  ModelAndViewaddAllObjects(Map modelMap)
     Add all entries contained in the provided map to the model.
public  ModelAndViewaddObject(Object modelObject)
     Add an object to the model using parameter name generation.
public  ModelAndViewaddObject(String modelName, Object modelObject)
     Add an object to the model.
public  voidclear()
     Clear the state of this ModelAndView object.
public  MapgetModel()
     Return the model map.
protected  MapgetModelInternal()
     Return the model map.
public  ModelMapgetModelMap()
     Return the underlying ModelMap instance (never null).
public  ViewgetView()
     Return the View object, or null if we are using a view name to be resolved by the DispatcherServlet via a ViewResolver.
public  StringgetViewName()
     Return the view name to be resolved by the DispatcherServlet via a ViewResolver, or null if we are using a View object.
public  booleanhasView()
     Indicate whether or not this ModelAndView has a view, either as a view name or as a direct View instance.
public  booleanisEmpty()
     Return whether this ModelAndView object is empty i.e.
public  booleanisReference()
     Return whether we use a view reference, i.e.
public  voidsetView(View view)
     Set a View object for this ModelAndView.
public  voidsetViewName(String viewName)
     Set a view name for this ModelAndView, to be resolved by the DispatcherServlet via a ViewResolver.
public  StringtoString()
     Return diagnostic information about this model and view.
public  booleanwasCleared()
     Return whether this ModelAndView object is empty as a result of a call to ModelAndView.clear i.e.


Constructor Detail
ModelAndView
public ModelAndView()(Code)
Default constructor for bean-style usage: populating bean properties instead of passing in constructor arguments.
See Also:   ModelAndView.setView(View)
See Also:   ModelAndView.setViewName(String)



ModelAndView
public ModelAndView(String viewName)(Code)
Convenient constructor when there is no model data to expose. Can also be used in conjunction with addObject.
Parameters:
  viewName - name of the View to render, to be resolvedby the DispatcherServlet's ViewResolver
See Also:   ModelAndView.addObject



ModelAndView
public ModelAndView(View view)(Code)
Convenient constructor when there is no model data to expose. Can also be used in conjunction with addObject.
Parameters:
  view - View object to render
See Also:   ModelAndView.addObject



ModelAndView
public ModelAndView(String viewName, Map model)(Code)
Creates new ModelAndView given a view name and a model.
Parameters:
  viewName - name of the View to render, to be resolvedby the DispatcherServlet's ViewResolver
Parameters:
  model - Map of model names (Strings) to model objects(Objects). Model entries may not be null, but themodel Map may be null if there is no model data.



ModelAndView
public ModelAndView(View view, Map model)(Code)
Creates new ModelAndView given a View object and a model. Note: the supplied model data is copied into the internal storage of this class. You should not consider to modify the supplied Map after supplying it to this class
Parameters:
  view - View object to render
Parameters:
  model - Map of model names (Strings) to model objects(Objects). Model entries may not be null, but themodel Map may be null if there is no model data.



ModelAndView
public ModelAndView(String viewName, String modelName, Object modelObject)(Code)
Convenient constructor to take a single model object.
Parameters:
  viewName - name of the View to render, to be resolvedby the DispatcherServlet's ViewResolver
Parameters:
  modelName - name of the single entry in the model
Parameters:
  modelObject - the single model object



ModelAndView
public ModelAndView(View view, String modelName, Object modelObject)(Code)
Convenient constructor to take a single model object.
Parameters:
  view - View object to render
Parameters:
  modelName - name of the single entry in the model
Parameters:
  modelObject - the single model object




Method Detail
addAllObjects
public ModelAndView addAllObjects(Map modelMap)(Code)
Add all entries contained in the provided map to the model.
Parameters:
  modelMap - a map of modelName -> modelObject pairs this ModelAndView, convenient to allow usages likereturn modelAndView.addAllObjects(myModelMap);



addObject
public ModelAndView addObject(Object modelObject)(Code)
Add an object to the model using parameter name generation.
Parameters:
  modelObject - the object to add to the model (never null)
See Also:   ModelMap.addObject(Object)



addObject
public ModelAndView addObject(String modelName, Object modelObject)(Code)
Add an object to the model.
Parameters:
  modelName - name of the object to add to the model (never null)
Parameters:
  modelObject - object to add to the model (can be null) this ModelAndView, convenient to allow usages likereturn modelAndView.addObject("foo", bar);



clear
public void clear()(Code)
Clear the state of this ModelAndView object. The object will be empty afterwards.

Can be used to suppress rendering of a given ModelAndView object in the postHandle method of a HandlerInterceptor.
See Also:   ModelAndView.isEmpty()
See Also:   HandlerInterceptor.postHandle




getModel
public Map getModel()(Code)
Return the model map. Never returns null. To be called by application code for modifying the model.



getModelInternal
protected Map getModelInternal()(Code)
Return the model map. May return null. Called by DispatcherServlet for evaluation of the model.



getModelMap
public ModelMap getModelMap()(Code)
Return the underlying ModelMap instance (never null).



getView
public View getView()(Code)
Return the View object, or null if we are using a view name to be resolved by the DispatcherServlet via a ViewResolver.



getViewName
public String getViewName()(Code)
Return the view name to be resolved by the DispatcherServlet via a ViewResolver, or null if we are using a View object.



hasView
public boolean hasView()(Code)
Indicate whether or not this ModelAndView has a view, either as a view name or as a direct View instance.



isEmpty
public boolean isEmpty()(Code)
Return whether this ModelAndView object is empty i.e. whether it does not hold any view and does not contain a model.



isReference
public boolean isReference()(Code)
Return whether we use a view reference, i.e. true if the view has been specified via a name to be resolved by the DispatcherServlet via a ViewResolver.



setView
public void setView(View view)(Code)
Set a View object for this ModelAndView. Will override any pre-existing view name or View.



setViewName
public void setViewName(String viewName)(Code)
Set a view name for this ModelAndView, to be resolved by the DispatcherServlet via a ViewResolver. Will override any pre-existing view name or View.



toString
public String toString()(Code)
Return diagnostic information about this model and view.



wasCleared
public boolean wasCleared()(Code)
Return whether this ModelAndView object is empty as a result of a call to ModelAndView.clear i.e. whether it does not hold any view and does not contain a model. Returns false if any additional state was added to the instance after the call to ModelAndView.clear .
See Also:   ModelAndView.clear()



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(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.