Java Doc for AbstractCachingViewResolver.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.AbstractCachingViewResolver

All known Subclasses:   org.springframework.web.servlet.view.XmlViewResolver,  org.springframework.web.servlet.view.UrlBasedViewResolver,  org.springframework.web.servlet.view.ResourceBundleViewResolver,
AbstractCachingViewResolver
abstract public class AbstractCachingViewResolver extends WebApplicationObjectSupport implements ViewResolver(Code)
Convenient base class for org.springframework.web.servlet.ViewResolver implementations. Caches org.springframework.web.servlet.View objects once resolved: This means that view resolution won't be a performance problem, no matter how costly initial view retrieval is.

Subclasses need to implement the AbstractCachingViewResolver.loadView template method, building the View object for a specific view name and locale.
author:
   Rod Johnson
author:
   Juergen Hoeller
See Also:   AbstractCachingViewResolver.loadView





Method Summary
public  voidclearCache()
     Clear the entire view cache, removing all cached view objects.
protected  ViewcreateView(String viewName, Locale locale)
     Create the actual View object.
protected  ObjectgetCacheKey(String viewName, Locale locale)
     Return the cache key for the given view name and the given locale.
public  booleanisCache()
     Return if caching is enabled.
abstract protected  ViewloadView(String viewName, Locale locale)
     Subclasses must implement this method, building a View object for the specified view.
public  voidremoveFromCache(String viewName, Locale locale)
     Provides functionality to clear the cache for a certain view.

This can be handy in case developer are able to modify views (e.g.

public  ViewresolveViewName(String viewName, Locale locale)
    
public  voidsetCache(boolean cache)
     Enable or disable caching.



Method Detail
clearCache
public void clearCache()(Code)
Clear the entire view cache, removing all cached view objects. Subsequent resolve calls will lead to recreation of demanded view objects.



createView
protected View createView(String viewName, Locale locale) throws Exception(Code)
Create the actual View object.

The default implementation delegates to AbstractCachingViewResolver.loadView . This can be overridden to resolve certain view names in a special fashion, before delegating to the actual loadView implementation provided by the subclass.
Parameters:
  viewName - the name of the view to retrieve
Parameters:
  locale - the Locale to retrieve the view for the View instance, or null if not found(optional, to allow for ViewResolver chaining)
throws:
  Exception - if the view couldn't be resolved
See Also:   AbstractCachingViewResolver.loadView




getCacheKey
protected Object getCacheKey(String viewName, Locale locale)(Code)
Return the cache key for the given view name and the given locale.

Default is a String consisting of view name and locale suffix. Can be overridden in subclasses.

Needs to respect the locale in general, as a different locale can lead to a different view resource.




isCache
public boolean isCache()(Code)
Return if caching is enabled.



loadView
abstract protected View loadView(String viewName, Locale locale) throws Exception(Code)
Subclasses must implement this method, building a View object for the specified view. The returned View objects will be cached by this ViewResolver base class.

Subclasses are not forced to support internationalization: A subclass that does not may simply ignore the locale parameter.
Parameters:
  viewName - the name of the view to retrieve
Parameters:
  locale - the Locale to retrieve the view for the View instance, or null if not found(optional, to allow for ViewResolver chaining)
throws:
  Exception - if the view couldn't be resolved
See Also:   AbstractCachingViewResolver.resolveViewName




removeFromCache
public void removeFromCache(String viewName, Locale locale)(Code)
Provides functionality to clear the cache for a certain view.

This can be handy in case developer are able to modify views (e.g. Velocity templates) at runtime after which you'd need to clear the cache for the specified view.
Parameters:
  viewName - the view name for which the cached view object(if any) needs to be removed
Parameters:
  locale - the locale for which the view object should be removed




resolveViewName
public View resolveViewName(String viewName, Locale locale) throws Exception(Code)



setCache
public void setCache(boolean cache)(Code)
Enable or disable caching.

Default is "true": caching is enabled. Disable this only for debugging and development.

Warning: Disabling caching can severely impact performance.




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.