Java Doc for ServletContextPropertyPlaceholderConfigurer.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.beans.factory.config.PropertyPlaceholderConfigurer
   org.springframework.web.context.support.ServletContextPropertyPlaceholderConfigurer

ServletContextPropertyPlaceholderConfigurer
public class ServletContextPropertyPlaceholderConfigurer extends PropertyPlaceholderConfigurer implements ServletContextAware(Code)
Subclass of PropertyPlaceholderConfigurer that resolves placeholders as ServletContext init parameters (that is, web.xml context-param entries).

Can be combined with "locations" and/or "properties" values in addition to web.xml context-params. Alternatively, can be defined without local properties, to resolve all placeholders as web.xml context-params (or JVM system properties).

If a placeholder could not be resolved against the provided local properties within the application, this configurer will fall back to ServletContext parameters. Can also be configured to let ServletContext init parameters override local properties (contextOverride=true).

Optionally supports searching for ServletContext attributes: If turned on, an otherwise unresolvable placeholder will matched against the corresponding ServletContext attribute, using its stringified value if found. This can be used to feed dynamic values into Spring's placeholder resolution.

If not running within a WebApplicationContext (or any other context that is able to satisfy the ServletContextAware callback), this class will behave like the default PropertyPlaceholderConfigurer. This allows for keeping ServletContextPropertyPlaceholderConfigurer definitions in test suites.
author:
   Juergen Hoeller
since:
   1.1.4
See Also:   ServletContextPropertyPlaceholderConfigurer.setLocations
See Also:   ServletContextPropertyPlaceholderConfigurer.setProperties
See Also:   ServletContextPropertyPlaceholderConfigurer.setSystemPropertiesModeName
See Also:   ServletContextPropertyPlaceholderConfigurer.setContextOverride
See Also:   ServletContextPropertyPlaceholderConfigurer.setSearchContextAttributes
See Also:   javax.servlet.ServletContext.getInitParameter(String)
See Also:   javax.servlet.ServletContext.getAttribute(String)





Method Summary
protected  StringresolvePlaceholder(String placeholder, Properties props)
    
protected  StringresolvePlaceholder(String placeholder, ServletContext servletContext, boolean searchContextAttributes)
     Resolves the given placeholder using the init parameters and optionally also the attributes of the given ServletContext.

Default implementation checks ServletContext attributes before init parameters.

public  voidsetContextOverride(boolean contextOverride)
     Set whether ServletContext init parameters (and optionally also ServletContext attributes) should override local properties within the application.
public  voidsetSearchContextAttributes(boolean searchContextAttributes)
     Set whether to search for matching a ServletContext attribute before checking a ServletContext init parameter.
public  voidsetServletContext(ServletContext servletContext)
     Set the ServletContext to resolve placeholders against.



Method Detail
resolvePlaceholder
protected String resolvePlaceholder(String placeholder, Properties props)(Code)



resolvePlaceholder
protected String resolvePlaceholder(String placeholder, ServletContext servletContext, boolean searchContextAttributes)(Code)
Resolves the given placeholder using the init parameters and optionally also the attributes of the given ServletContext.

Default implementation checks ServletContext attributes before init parameters. Can be overridden to customize this behavior, potentially also applying specific naming patterns for parameters and/or attributes (instead of using the exact placeholder name).
Parameters:
  placeholder - the placeholder to resolve
Parameters:
  servletContext - the ServletContext to check
Parameters:
  searchContextAttributes - whether to search for a matchingServletContext attribute the resolved value, of null if none
See Also:   javax.servlet.ServletContext.getInitParameter(String)
See Also:   javax.servlet.ServletContext.getAttribute(String)




setContextOverride
public void setContextOverride(boolean contextOverride)(Code)
Set whether ServletContext init parameters (and optionally also ServletContext attributes) should override local properties within the application. Default is "false": ServletContext settings serve as fallback.

Note that system properties will still override ServletContext settings, if the system properties mode is set to "SYSTEM_PROPERTIES_MODE_OVERRIDE".
See Also:   ServletContextPropertyPlaceholderConfigurer.setSearchContextAttributes
See Also:   ServletContextPropertyPlaceholderConfigurer.setSystemPropertiesModeName
See Also:   ServletContextPropertyPlaceholderConfigurer.SYSTEM_PROPERTIES_MODE_OVERRIDE




setSearchContextAttributes
public void setSearchContextAttributes(boolean searchContextAttributes)(Code)
Set whether to search for matching a ServletContext attribute before checking a ServletContext init parameter. Default is "false": only checking init parameters.

If turned on, the configurer will look for a ServletContext attribute with the same name as the placeholder, and use its stringified value if found. Exposure of such ServletContext attributes can be used to dynamically override init parameters defined in web.xml, for example in a custom context listener.
See Also:   javax.servlet.ServletContext.getInitParameter(String)
See Also:   javax.servlet.ServletContext.getAttribute(String)




setServletContext
public void setServletContext(ServletContext servletContext)(Code)
Set the ServletContext to resolve placeholders against. Will be auto-populated when running in a WebApplicationContext.

If not set, this configurer will simply not resolve placeholders against the ServletContext: It will effectively behave like a plain PropertyPlaceholderConfigurer in such a scenario.




Fields inherited from org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
final public static String DEFAULT_PLACEHOLDER_PREFIX(Code)(Java Doc)
final public static String DEFAULT_PLACEHOLDER_SUFFIX(Code)(Java Doc)
final public static int SYSTEM_PROPERTIES_MODE_FALLBACK(Code)(Java Doc)
final public static int SYSTEM_PROPERTIES_MODE_NEVER(Code)(Java Doc)
final public static int SYSTEM_PROPERTIES_MODE_OVERRIDE(Code)(Java Doc)

Methods inherited from org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
protected String parseStringValue(String strVal, Properties props, Set visitedPlaceholders) throws BeanDefinitionStoreException(Code)(Java Doc)
protected void processProperties(ConfigurableListableBeanFactory beanFactoryToProcess, Properties props) throws BeansException(Code)(Java Doc)
protected String resolvePlaceholder(String placeholder, Properties props, int systemPropertiesMode)(Code)(Java Doc)
protected String resolvePlaceholder(String placeholder, Properties props)(Code)(Java Doc)
protected String resolveSystemProperty(String key)(Code)(Java Doc)
public void setBeanFactory(BeanFactory beanFactory)(Code)(Java Doc)
public void setBeanName(String beanName)(Code)(Java Doc)
public void setIgnoreUnresolvablePlaceholders(boolean ignoreUnresolvablePlaceholders)(Code)(Java Doc)
public void setPlaceholderPrefix(String placeholderPrefix)(Code)(Java Doc)
public void setPlaceholderSuffix(String placeholderSuffix)(Code)(Java Doc)
public void setSearchSystemEnvironment(boolean searchSystemEnvironment)(Code)(Java Doc)
public void setSystemPropertiesMode(int systemPropertiesMode)(Code)(Java Doc)
public void setSystemPropertiesModeName(String constantName) throws IllegalArgumentException(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.