Basic full configuration for Jersey on Tomcat in eclipse

后端 未结 2 1391
独厮守ぢ
独厮守ぢ 2021-01-24 02:23

I\'m new to Jersey and trying to set up a basic webapp using Tomcat and eclipse. I\'ve looked at numerous tutorials and examples, but they\'re all different from each other, or

2条回答
  •  北荒
    北荒 (楼主)
    2021-01-24 02:53

    Adding to the answer, if you are using jackson then dependency is already mentioned as jersey-media-json-jackson -

    
        org.glassfish.jersey.media
        jersey-media-json-jackson
        ${jersey.version}
    
    

    There are other json providers as well.

    If you want to use MOXy as your JAXB implementation, then you can use

    
        org.glassfish.jersey.media
        jersey-media-moxy
        ${jersey.version}
    
    

    To use JSON-P as your JSON provider you need to add

    
        org.glassfish.jersey.media
        jersey-media-json-processing
        ${jersey.version}
    
    

    To use Jettison as your JSON provider you need to add jersey-media-json-jettison module to your pom.xml file:

    
        org.glassfish.jersey.media
        jersey-media-json-jettison
        ${jersey.version}
    
    

    To use multipart features you need to add jersey-media-multipart module to your pom.xml file:

    
        org.glassfish.jersey.media
        jersey-media-multipart
        ${jersey.version}
    
    

    Further details, please refer to https://jersey.java.net/documentation/latest/media.html

提交回复
热议问题