* <code>StandardWrapper</code> using the information contained
* in the deployment descriptor (Welcome Files, JSP, Servlets etc.)
*/
protected static void configureStandardContext(WebModule webModule,
WebBundleDescriptorImpl wmd) {
StandardWrapper wrapper;
Enumeration enumeration;
SecurityRoleReference securityRoleReference;
for (WebComponentDescriptor webComponentDesc :
wmd.getWebComponentDescriptors()) {
if (!webComponentDesc.isEnabled()) {
continue;
}
wrapper = (StandardWrapper)webModule.createWrapper();
wrapper.setName(webComponentDesc.getCanonicalName());
String impl = webComponentDesc.getWebComponentImplementation();
if (impl != null && !impl.isEmpty()) {
if (webComponentDesc.isServlet()){
wrapper.setServletClassName(impl);
} else {
wrapper.setJspFile(impl);
}
}
/*
* Add the wrapper only after we have set its
* servletClassName, so we know whether we're dealing with
* a JSF app
*/
webModule.addChild(wrapper);
enumeration = webComponentDesc.getInitializationParameters();
InitializationParameter initP = null;
while (enumeration.hasMoreElements()) {
initP = (InitializationParameter)enumeration.nextElement();
wrapper.addInitParameter(initP.getName(), initP.getValue());
}
if (webComponentDesc.getLoadOnStartUp() != null) {
wrapper.setLoadOnStartup(webComponentDesc.getLoadOnStartUp());
}
if (webComponentDesc.isAsyncSupported() != null) {
wrapper.setIsAsyncSupported(webComponentDesc.isAsyncSupported());
}
if (webComponentDesc.getRunAsIdentity() != null) {
wrapper.setRunAs(webComponentDesc.getRunAsIdentity().getRoleName());
}
for (String pattern : webComponentDesc.getUrlPatternsSet()) {
webModule.addServletMapping(pattern,
webComponentDesc.getCanonicalName());
}
enumeration = webComponentDesc.getSecurityRoleReferences();
while (enumeration.hasMoreElements()){
securityRoleReference = (SecurityRoleReference)
enumeration.nextElement();
wrapper.addSecurityReference(
securityRoleReference.getRoleName(),
securityRoleReference.getSecurityRoleLink().getName());
}
MultipartConfig mpConfig = webComponentDesc.getMultipartConfig();
if (mpConfig != null) {
wrapper.setMultipartLocation(mpConfig.getLocation());
wrapper.setMultipartMaxFileSize(mpConfig.getMaxFileSize());
wrapper.setMultipartMaxRequestSize(mpConfig.getMaxRequestSize());
wrapper.setMultipartFileSizeThreshold(mpConfig.getFileSizeThreshold());
}
}
SessionConfig sessionConfig = wmd.getSessionConfig();