undertow/src/main/java/org/wildfly/extension/undertow/deployment/UndertowDeploymentProcessor.java
void processManagement(final DeploymentUnit unit, JBossWebMetaData metaData) {
        final DeploymentResourceSupport deploymentResourceSupport = unit.getAttachment(Attachments.DEPLOYMENT_RESOURCE_SUPPORT);
        for (final JBossServletMetaData servlet : metaData.getServlets()) {
            try {
                final String name = servlet.getName();
                final ModelNode node = deploymentResourceSupport.getDeploymentSubModel(UndertowExtension.SUBSYSTEM_NAME, PathElement.pathElement("servlet", name));
                node.get("servlet-class").set(servlet.getServletClass());
                node.get("servlet-name").set(servlet.getServletName());
            } catch (Exception e) {
                // Should a failure in creating the mgmt view also make to the deployment to fail?
                continue;
            }
        }

    }
void processManagement(final DeploymentUnit unit, JBossWebMetaData metaData) {
        final DeploymentResourceSupport deploymentResourceSupport = unit.getAttachment(Attachments.DEPLOYMENT_RESOURCE_SUPPORT);
        for (final JBossServletMetaData servlet : metaData.getServlets()) {
            try {
                final String name = servlet.getName();
                final ModelNode node = deploymentResourceSupport.getDeploymentSubModel(UndertowExtension.SUBSYSTEM_NAME, PathElement.pathElement("servlet", name));
                node.get("servlet-class").set(servlet.getServletClass());
                node.get("servlet-name").set(servlet.getServletName());
            } catch (Exception e) {
                // Should a failure in creating the mgmt view also make to the deployment to fail?
                continue;
            }
        }

    }
void processManagement ( final DeploymentUnit unit , JBossWebMetaData metaData ) { final DeploymentResourceSupport deploymentResourceSupport = unit . getAttachment ( Attachments . DEPLOYMENT_RESOURCE_SUPPORT ) ; for ( final JBossServletMetaData servlet : metaData . getServlets ( ) ) { try { final String name = servlet . getName ( ) ; final ModelNode node = deploymentResourceSupport . getDeploymentSubModel ( UndertowExtension . SUBSYSTEM_NAME , PathElement . pathElement ( "servlet" , name ) ) ; node . get ( "servlet-class" ) . set ( servlet . getServletClass ( ) ) ; node . get ( "servlet-name" ) . set ( servlet . getServletName ( ) ) ; } catch ( Exception e ) { // Should a failure in creating the mgmt view also make to the deployment to fail? continue ; } } }
todo move to UndertowDeploymentService and use all registered servlets from Deployment instead of just one found by metadata
todo move to UndertowDeploymentService and use all registered servlets from Deployment instead of just one found by metadata