Java Doc for XmlWebApplicationContext.java in  » J2EE » spring-framework-2.5 » org » springframework » web » context » support » 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.5 » org.springframework.web.context.support 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.springframework.web.context.support.AbstractRefreshableWebApplicationContext
   org.springframework.web.context.support.XmlWebApplicationContext

XmlWebApplicationContext
public class XmlWebApplicationContext extends AbstractRefreshableWebApplicationContext (Code)
org.springframework.web.context.WebApplicationContext implementation which takes its configuration from XML documents, understood by an org.springframework.beans.factory.xml.XmlBeanDefinitionReader . This is essentially the equivalent of org.springframework.context.support.AbstractXmlApplicationContext for a web environment.

By default, the configuration will be taken from "/WEB-INF/applicationContext.xml" for the root context, and "/WEB-INF/test-servlet.xml" for a context with the namespace "test-servlet" (like for a DispatcherServlet instance with the servlet-name "test").

The config location defaults can be overridden via the "contextConfigLocation" context-param of org.springframework.web.context.ContextLoader and servlet init-param of org.springframework.web.servlet.FrameworkServlet . Config locations can either denote concrete files like "/WEB-INF/context.xml" or Ant-style patterns like "/WEB-INF/*-context.xml" (see org.springframework.util.PathMatcher javadoc for pattern details).

Note: In case of multiple config locations, later bean definitions will override ones defined in earlier loaded files. This can be leveraged to deliberately override certain bean definitions via an extra XML file.

For a WebApplicationContext that reads in a different bean definition format, create an analogous subclass of AbstractRefreshableWebApplicationContext . Such a context implementation can be specified as "contextClass" context-param for ContextLoader or "contextClass" init-param for FrameworkServlet.
author:
   Rod Johnson
author:
   Juergen Hoeller
See Also:   XmlWebApplicationContext.setNamespace
See Also:   XmlWebApplicationContext.setConfigLocations
See Also:   org.springframework.beans.factory.xml.XmlBeanDefinitionReader
See Also:   org.springframework.web.context.ContextLoader.initWebApplicationContext
See Also:   org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext



Field Summary
final public static  StringDEFAULT_CONFIG_LOCATION
    
final public static  StringDEFAULT_CONFIG_LOCATION_PREFIX
    
final public static  StringDEFAULT_CONFIG_LOCATION_SUFFIX
    


Method Summary
protected  String[]getDefaultConfigLocations()
     The default location for the root context is "/WEB-INF/applicationContext.xml", and "/WEB-INF/test-servlet.xml" for a context with the namespace "test-servlet" (like for a DispatcherServlet instance with the servlet-name "test").
protected  voidinitBeanDefinitionReader(XmlBeanDefinitionReader beanDefinitionReader)
     Initialize the bean definition reader used for loading the bean definitions of this context.
protected  voidloadBeanDefinitions(DefaultListableBeanFactory beanFactory)
     Loads the bean definitions via an XmlBeanDefinitionReader.
protected  voidloadBeanDefinitions(XmlBeanDefinitionReader reader)
     Load the bean definitions with the given XmlBeanDefinitionReader.

Field Detail
DEFAULT_CONFIG_LOCATION
final public static String DEFAULT_CONFIG_LOCATION(Code)
Default config location for the root context



DEFAULT_CONFIG_LOCATION_PREFIX
final public static String DEFAULT_CONFIG_LOCATION_PREFIX(Code)
Default prefix for building a config location for a namespace



DEFAULT_CONFIG_LOCATION_SUFFIX
final public static String DEFAULT_CONFIG_LOCATION_SUFFIX(Code)
Default suffix for building a config location for a namespace





Method Detail
getDefaultConfigLocations
protected String[] getDefaultConfigLocations()(Code)
The default location for the root context is "/WEB-INF/applicationContext.xml", and "/WEB-INF/test-servlet.xml" for a context with the namespace "test-servlet" (like for a DispatcherServlet instance with the servlet-name "test").



initBeanDefinitionReader
protected void initBeanDefinitionReader(XmlBeanDefinitionReader beanDefinitionReader)(Code)
Initialize the bean definition reader used for loading the bean definitions of this context. Default implementation is empty.

Can be overridden in subclasses, e.g. for turning off XML validation or using a different XmlBeanDefinitionParser implementation.
Parameters:
  beanDefinitionReader - the bean definition reader used by this context
See Also:   org.springframework.beans.factory.xml.XmlBeanDefinitionReader.setValidationMode
See Also:   org.springframework.beans.factory.xml.XmlBeanDefinitionReader.setDocumentReaderClass




loadBeanDefinitions
protected void loadBeanDefinitions(DefaultListableBeanFactory beanFactory) throws IOException(Code)
Loads the bean definitions via an XmlBeanDefinitionReader.
See Also:   org.springframework.beans.factory.xml.XmlBeanDefinitionReader
See Also:   XmlWebApplicationContext.initBeanDefinitionReader
See Also:   XmlWebApplicationContext.loadBeanDefinitions



loadBeanDefinitions
protected void loadBeanDefinitions(XmlBeanDefinitionReader reader) throws BeansException, IOException(Code)
Load the bean definitions with the given XmlBeanDefinitionReader.

The lifecycle of the bean factory is handled by the refreshBeanFactory method; therefore this method is just supposed to load and/or register bean definitions.

Delegates to a ResourcePatternResolver for resolving location patterns into Resource instances.
throws:
  org.springframework.beans.BeansException - in case of bean registration errors
throws:
  java.io.IOException - if the required XML document isn't found
See Also:   XmlWebApplicationContext.refreshBeanFactory
See Also:   XmlWebApplicationContext.getConfigLocations
See Also:   XmlWebApplicationContext.getResources
See Also:   XmlWebApplicationContext.getResourcePatternResolver




Methods inherited from org.springframework.web.context.support.AbstractRefreshableWebApplicationContext
public String[] getConfigLocations()(Code)(Java Doc)
protected String[] getDefaultConfigLocations()(Code)(Java Doc)
public String getNamespace()(Code)(Java Doc)
protected Resource getResourceByPath(String path)(Code)(Java Doc)
protected ResourcePatternResolver getResourcePatternResolver()(Code)(Java Doc)
public ServletConfig getServletConfig()(Code)(Java Doc)
public ServletContext getServletContext()(Code)(Java Doc)
public Theme getTheme(String themeName)(Code)(Java Doc)
protected void onRefresh()(Code)(Java Doc)
protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)(Code)(Java Doc)
protected String resolvePath(String path)(Code)(Java Doc)
public void setConfigLocations(String[] locations)(Code)(Java Doc)
public void setNamespace(String namespace)(Code)(Java Doc)
public void setServletConfig(ServletConfig servletConfig)(Code)(Java Doc)
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.