@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); WarMetaData metaData = deploymentUnit.getAttachment(WarMetaData.ATTACHMENT_KEY); if(JsfVersionMarker.isJsfDisabled(deploymentUnit)) { return; } if(metaData == null || metaData.getMergedJBossWebMetaData() == null || metaData.getMergedJBossWebMetaData().getServlets() == null) { return; } JBossServletMetaData jsf = null; for(JBossServletMetaData servlet : metaData.getMergedJBossWebMetaData().getServlets()) { if(JAVAX_FACES_WEBAPP_FACES_SERVLET.equals(servlet.getServletClass())) { jsf = servlet; } } if(jsf != null) { if(jsf.getMultipartConfig() == null) { //WFLY-2329 File upload doesn't work jsf.setMultipartConfig(new MultipartConfigMetaData()); } } if (disallowDoctypeDecl != null) { // Add the disallowDoctypeDecl context param if it's not already present setContextParameterIfAbsent(metaData.getMergedJBossWebMetaData(), DISALLOW_DOCTYPE_DECL, disallowDoctypeDecl.toString()); } }
if (servlet.getMultipartConfig() != null) { MultipartConfigMetaData mp = servlet.getMultipartConfig(); s.setMultipartConfig(Servlets.multipartConfig(mp.getLocation(), mp.getMaxFileSize(), mp.getMaxRequestSize(), mp.getFileSizeThreshold()));
if (annotation.getMultipartConfig() != null && servlet.getMultipartConfig() == null)
if (annotation.getMultipartConfig() != null && servlet.getMultipartConfig() == null) { MultipartConfigMetaData multipartConfig = new MultipartConfigMetaData(); MultipartConfigMetaData webFragmentMetaData = annotation.getMultipartConfig();
if (servlet.getMultipartConfig() != null) { MultipartConfigMetaData mp = servlet.getMultipartConfig(); s.setMultipartConfig(Servlets.multipartConfig(mp.getLocation(), mp.getMaxFileSize(), mp.getMaxRequestSize(), mp.getFileSizeThreshold()));
if (servlet.getMultipartConfig() != null) { MultipartConfigMetaData mp = servlet.getMultipartConfig(); s.setMultipartConfig(Servlets.multipartConfig(mp.getLocation(), mp.getMaxFileSize(), mp.getMaxRequestSize(), mp.getFileSizeThreshold()));
wrapper.setEnabled(value.isEnabled()); if (value.getMultipartConfig() != null) MultipartConfigMetaData multipartConfigMetaData = value.getMultipartConfig(); Multipart multipartConfig = new Multipart(); multipartConfig.setLocation(multipartConfigMetaData.getLocation());