Glass Fish |
MOXy is enabled by default if you add the dependency to your Maven project.
1 2 3 4 5 | < dependency > < groupid >org.glassfish.jersey.media</ groupId > < artifactid >jersey-media-moxy</ artifactId > < version >2.26</ version > </ dependency > |
@XmlRootElement
annotation to the model class. The rest was handled automagically.The entire project including a war file are available on Github: jaxrs-form-data-parameters.
A simple platform independent file is used to setup the application.
We set up web resource (service) to handle our requests.
That's it! You now have a JAX-RS Web Service. The project runs successfully on GlassFish 5.0 (.war file on GitHub).
NOTE: MOXy has some issues running on GlassFish 4.1, 4.1.1, and 4.2.