What is best approach for implementing Jersey 2.x on Tomcat 8?

后端 未结 2 813
花落未央
花落未央 2021-01-31 00:27

I have Knowledge of the Web container and Tomcat and can deploy static and dynamic web sites. But I am new to REST and Jersey. I have read the 2.6 user\'s guide, reviewed many

2条回答
  •  迷失自我
    2021-01-31 00:52

    I was able to get this working using the directions supplied in the Jersey 2.6 user's guide for deployment to a 3.x servlet container. I ended up using something similar to the item below. Because the URL mapping is supplied in the .xml, you can omit @ApplicationPath from the Application subclass.

    
    
        
        
            org.example.MyApplication
        
    
        
        
            org.example.MyApplication
            /myresources/*
        
    
    

提交回复
热议问题