Java Doc for ResourceBundleViewResolver.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.servlet.view.AbstractCachingViewResolver
   org.springframework.web.servlet.view.ResourceBundleViewResolver

ResourceBundleViewResolver
public class ResourceBundleViewResolver extends AbstractCachingViewResolver implements Ordered,DisposableBean(Code)
org.springframework.web.servlet.ViewResolver implementation that uses bean definitions in a ResourceBundle , specified by the bundle basename.

The bundle is typically defined in a properties file, located in the class path. The default bundle basename is "views".

This ViewResolver supports localized view definitions, using the default support of java.util.PropertyResourceBundle . For example, the basename "views" will be resolved as class path resources "views_de_AT.properties", "views_de.properties", "views.properties" - for a given Locale "de_AT".

Note: this ViewResolver implements the Ordered interface to allow for flexible participation in ViewResolver chaining. For example, some special views could be defined via this ViewResolver (giving it 0 as "order" value), while all remaining views could be resolved by a UrlBasedViewResolver .
author:
   Rod Johnson
author:
   Juergen Hoeller
See Also:   java.util.ResourceBundle.getBundle
See Also:   java.util.PropertyResourceBundle
See Also:   UrlBasedViewResolver



Field Summary
final public static  StringDEFAULT_BASENAME
     The default basename if no other basename is supplied.


Method Summary
public  voiddestroy()
     Close the bundle View factories on context shutdown.
protected  ResourceBundlegetBundle(String basename, Locale locale)
     Obtain the resource bundle for the given basename and Locale .
protected  ClassLoadergetBundleClassLoader()
     Return the ClassLoader to load resource bundles with.
public  intgetOrder()
    
protected  voidinitApplicationContext()
    
protected synchronized  BeanFactoryinitFactory(Locale locale)
     Initialize the View BeanFactory from the ResourceBundle, for the given Locale locale .
protected  ViewloadView(String viewName, Locale locale)
    
public  voidsetBasename(String basename)
     Set a single basename, following java.util.ResourceBundle conventions. The default is "views".

ResourceBundle supports different suffixes.

public  voidsetBasenames(String[] basenames)
     Set an array of basenames, each following java.util.ResourceBundle conventions.
public  voidsetBundleClassLoader(ClassLoader classLoader)
     Set the ClassLoader to load resource bundles with.
public  voidsetDefaultParentView(String defaultParentView)
     Set the default parent for views defined in the ResourceBundle.

This avoids repeated "yyy1.(parent)=xxx", "yyy2.(parent)=xxx" definitions in the bundle, especially if all defined views share the same parent.

The parent will typically define the view class and common attributes. Concrete views might simply consist of an URL definition then: a la "yyy1.url=/my.jsp", "yyy2.url=/your.jsp".

View definitions that define their own parent or carry their own class can still override this.

public  voidsetLocalesToInitialize(Locale[] localesToInitialize)
     Specify Locales to initialize eagerly, rather than lazily when actually accessed.
public  voidsetOrder(int order)
    

Field Detail
DEFAULT_BASENAME
final public static String DEFAULT_BASENAME(Code)
The default basename if no other basename is supplied.





Method Detail
destroy
public void destroy() throws BeansException(Code)
Close the bundle View factories on context shutdown.



getBundle
protected ResourceBundle getBundle(String basename, Locale locale) throws MissingResourceException(Code)
Obtain the resource bundle for the given basename and Locale .
Parameters:
  basename - the basename to look for
Parameters:
  locale - the Locale to look for the corresponding ResourceBundle
throws:
  MissingResourceException - if no matching bundle could be found
See Also:   java.util.ResourceBundle.getBundle(Stringjava.util.LocaleClassLoader)



getBundleClassLoader
protected ClassLoader getBundleClassLoader()(Code)
Return the ClassLoader to load resource bundles with.

Default is the specified bundle ClassLoader, usually the thread context ClassLoader.




getOrder
public int getOrder()(Code)



initApplicationContext
protected void initApplicationContext() throws BeansException(Code)



initFactory
protected synchronized BeanFactory initFactory(Locale locale) throws BeansException(Code)
Initialize the View BeanFactory from the ResourceBundle, for the given Locale locale .

Synchronized because of access by parallel threads.
Parameters:
  locale - the target Locale the View factory for the given Locale
throws:
  BeansException - in case of initialization errors




loadView
protected View loadView(String viewName, Locale locale) throws Exception(Code)



setBasename
public void setBasename(String basename)(Code)
Set a single basename, following java.util.ResourceBundle conventions. The default is "views".

ResourceBundle supports different suffixes. For example, a base name of "views" might map to ResourceBundle files "views", "views_en_au" and "views_de".

Note that ResourceBundle names are effectively classpath locations: As a consequence, the JDK's standard ResourceBundle treats dots as package separators. This means that "test.theme" is effectively equivalent to "test/theme", just like it is for programmatic java.util.ResourceBundle usage.
See Also:   ResourceBundleViewResolver.setBasenames
See Also:   java.util.ResourceBundle.getBundle(String)




setBasenames
public void setBasenames(String[] basenames)(Code)
Set an array of basenames, each following java.util.ResourceBundle conventions. The default is a single basename "views".

ResourceBundle supports different suffixes. For example, a base name of "views" might map to ResourceBundle files "views", "views_en_au" and "views_de".

The associated resource bundles will be checked sequentially when resolving a message code. Note that message definitions in a previous resource bundle will override ones in a later bundle, due to the sequential lookup.

Note that ResourceBundle names are effectively classpath locations: As a consequence, the JDK's standard ResourceBundle treats dots as package separators. This means that "test.theme" is effectively equivalent to "test/theme", just like it is for programmatic java.util.ResourceBundle usage.
See Also:   ResourceBundleViewResolver.setBasename
See Also:   java.util.ResourceBundle.getBundle(String)




setBundleClassLoader
public void setBundleClassLoader(ClassLoader classLoader)(Code)
Set the ClassLoader to load resource bundles with. Default is the thread context ClassLoader.



setDefaultParentView
public void setDefaultParentView(String defaultParentView)(Code)
Set the default parent for views defined in the ResourceBundle.

This avoids repeated "yyy1.(parent)=xxx", "yyy2.(parent)=xxx" definitions in the bundle, especially if all defined views share the same parent.

The parent will typically define the view class and common attributes. Concrete views might simply consist of an URL definition then: a la "yyy1.url=/my.jsp", "yyy2.url=/your.jsp".

View definitions that define their own parent or carry their own class can still override this. Strictly speaking, the rule that a default parent setting does not apply to a bean definition that carries a class is there for backwards compatiblity reasons. It still matches the typical use case.




setLocalesToInitialize
public void setLocalesToInitialize(Locale[] localesToInitialize)(Code)
Specify Locales to initialize eagerly, rather than lazily when actually accessed.

Allows for pre-initialization of common Locales, eagerly checking the view configuration for those Locales.




setOrder
public void setOrder(int order)(Code)



Methods inherited from org.springframework.web.servlet.view.AbstractCachingViewResolver
public void clearCache()(Code)(Java Doc)
protected View createView(String viewName, Locale locale) throws Exception(Code)(Java Doc)
protected Object getCacheKey(String viewName, Locale locale)(Code)(Java Doc)
public boolean isCache()(Code)(Java Doc)
abstract protected View loadView(String viewName, Locale locale) throws Exception(Code)(Java Doc)
public void removeFromCache(String viewName, Locale locale)(Code)(Java Doc)
public View resolveViewName(String viewName, Locale locale) throws Exception(Code)(Java Doc)
public void setCache(boolean cache)(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.