Create RESTful Web Service with JAX-RS and deploy it to tomcat

后端 未结 2 828
遇见更好的自我
遇见更好的自我 2021-01-12 23:11

I\'m trying to create and deploy a RESTful Web Service using JAX-RS and deploy it to tomcat. I don\'t want to use any IDE. In Tomcat I have the following directory structure

2条回答
  •  情话喂你
    2021-01-12 23:39

    You have the wrong class for your Servlet. Not sure why you are not wanting to use an IDE, but there is a maven archetype that will layout your project structure for you using the appropriate classes that the Jersey developers have defined. My web.xml looks like this:

    
        Jersey Web Application
        org.glassfish.jersey.servlet.ServletContainer
        
            jersey.config.server.provider.packages
            com.pluralsight
        
        1
    
    
        Jersey Web Application
        /webapi/*
    
    

    I cover all of this in this course here.

提交回复
热议问题