Package org.apache.struts2.config
Class StrutsXmlConfigurationProvider
java.lang.Object
org.apache.struts2.config.providers.XmlDocConfigurationProvider
org.apache.struts2.config.providers.XmlConfigurationProvider
org.apache.struts2.config.StrutsXmlConfigurationProvider
- All Implemented Interfaces:
- ConfigurationProvider,- ContainerProvider,- PackageProvider
Override Xwork class so we can use an arbitrary config file
- 
Field SummaryFields inherited from class org.apache.struts2.config.providers.XmlConfigurationProviderfileManagerFields inherited from class org.apache.struts2.config.providers.XmlDocConfigurationProviderallowlistClasses, configuration, declaredPackages, documents, dtdMappings, objectFactory, providerAllowlist, throwExceptionOnDuplicateBeans, valueSubstitutor
- 
Constructor SummaryConstructorsConstructorDescriptionConstructs the Struts configuration provider using the default struts.xml and no ServletContextStrutsXmlConfigurationProvider(String filename) Constructs the configuration provider based on the provided config fileStrutsXmlConfigurationProvider(String filename, jakarta.servlet.ServletContext ctx) Constructs the Struts configuration provider
- 
Method SummaryModifier and TypeMethodDescriptionprotected URLfindInFileSystem(String fileName) getConfigurationUrls(String fileName) Look for the configuration file on the classpath and in the file systemvoidLoads the packages for the configuration.booleanOverrides needs reload to ensure it is only checked once per requestvoidregister(ContainerBuilder containerBuilder, LocatableProperties props) Registers beans and properties for the ContainertoString()Methods inherited from class org.apache.struts2.config.providers.XmlConfigurationProviderequals, getDocs, getFinalDocs, getURLs, hashCode, init, loadConfigurationFiles, parseFile, setFileManagerFactoryMethods inherited from class org.apache.struts2.config.providers.XmlDocConfigurationProvideraddAction, addAllowedMethodsToSet, addPackage, addResultTypes, allowAndLoadClass, buildActionConfig, buildAllowedMethods, buildExceptionMappings, buildInterceptorConfig, buildInterceptorList, buildPackageContext, buildResultConfig, buildResultParams, buildResults, buildResultTypeConfig, destroy, getDtdMappings, guessResultType, iterateChildren, iterateChildrenByTagName, iterateElementChildren, iterateElementChildren, loadClass, loadDefaultActionRef, loadDefaultClassRef, loadDefaultInterceptorRef, loadExtraConfiguration, loadGlobalAllowedMethods, loadGlobalExceptionMappings, loadGlobalResults, loadInterceptors, loadInterceptorStack, loadInterceptorStacks, lookupInterceptorReference, registerBean, registerBeanSelection, registerConstant, registerUnknownHandlerStack, setDtdMappings, setObjectFactory, setProviderAllowlist, setThrowExceptionOnDuplicateBeans, setValueSubstitutor, verifyAction, verifyInterceptor, verifyResultType
- 
Constructor Details- 
StrutsXmlConfigurationProviderpublic StrutsXmlConfigurationProvider()Constructs the Struts configuration provider using the default struts.xml and no ServletContext
- 
StrutsXmlConfigurationProviderConstructs the configuration provider based on the provided config file- Parameters:
- filename- file with Struts configuration
 
- 
StrutsXmlConfigurationProviderConstructs the Struts configuration provider- Parameters:
- filename- The filename to look for
- ctx- Our ServletContext
 
 
- 
- 
Method Details- 
registerpublic void register(ContainerBuilder containerBuilder, LocatableProperties props) throws ConfigurationException Description copied from interface:ContainerProviderRegisters beans and properties for the Container- Specified by:
- registerin interface- ContainerProvider
- Overrides:
- registerin class- XmlConfigurationProvider
- Parameters:
- containerBuilder- The builder to register beans with
- props- The properties to register constants with
- Throws:
- ConfigurationException- If anything goes wrong
 
- 
loadPackagespublic void loadPackages()Description copied from interface:PackageProviderLoads the packages for the configuration.- Specified by:
- loadPackagesin interface- PackageProvider
- Overrides:
- loadPackagesin class- XmlConfigurationProvider
 
- 
getConfigurationUrlsLook for the configuration file on the classpath and in the file system- Overrides:
- getConfigurationUrlsin class- XmlConfigurationProvider
- Parameters:
- fileName- The file name to retrieve
- Throws:
- IOException
- See Also:
 
- 
findInFileSystem- Throws:
- IOException
 
- 
needsReloadpublic boolean needsReload()Overrides needs reload to ensure it is only checked once per request- Specified by:
- needsReloadin interface- ContainerProvider
- Specified by:
- needsReloadin interface- PackageProvider
- Overrides:
- needsReloadin class- XmlConfigurationProvider
- Returns:
- true if the file has been changed since the last time we read it
 
- 
toString- Overrides:
- toStringin class- XmlConfigurationProvider
 
 
-