How to define Context Path in Wildfly?

前端 未结 2 424
耶瑟儿~
耶瑟儿~ 2020-12-03 17:11

I\'ve used the following code to set the Context Path in tomcat where I can access my application directly using localhost:8080 by overriding the tomcat\'s defa

相关标签:
2条回答
  • 2020-12-03 17:50

    You can do this in the by adding a /WEB-INF/jboss-web.xml file in the application that you deploy:

    <?xml version="1.0" encoding="UTF-8"?>
    <jboss-web xmlns="http://www.jboss.com/xml/ns/javaee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="
          http://www.jboss.com/xml/ns/javaee
          http://www.jboss.org/j2ee/schema/jboss-web_5_1.xsd">
       <context-root>/</context-root>
    </jboss-web>
    
    0 讨论(0)
  • 2020-12-03 18:13

    Change context-root directly in WebService class with annotation.

    import org.jboss.ws.api.annotation.WebContext;
    
    @Stateless
    @WebService(portName = "SampleWSPort", serviceName = "SampleWS")
    @SOAPBinding(style = Style.DOCUMENT)
    @WebContext(contextRoot = "/SWS", urlPattern = "/SampleWS")
    public class SampleWS implements SampleWSInterface {
    

    org.jboss.ws.api.annotation.WebContext is in MAVEN artifact:

    <dependency>
       <groupId>org.jboss.ws</groupId>
       <artifactId>jbossws-api</artifactId>
       <version>1.1.2.Final</version>
    </dependency>
    
    0 讨论(0)
提交回复
热议问题