Reputation: 932
I have an .jar application (using ejbs) deployed as part of an .ear archive.
Inside this .jar application I have classes annotated with @Path
and @Stateless
.
My question is: Are my JAX-RS resources going to be deployed inside an EJB container or inside WEB (Servlet) container? Do I need to define web.xml and to put servlet definition inside of it?
Upvotes: 0
Views: 69
Reputation: 208944
Are my JAX-RS resources going to be deployed inside an EJB container or inside WEB (Servlet) container?
It will be deployed to the servlet container of your EE server.
Do I need to define web.xml and to put servlet definition inside of it?
Not necessarily. You can configure a JAX-RS application simply by having an empty Application
subclass annotated with @ApplicationPath
1.
@ApplicationPath("/api")
public class RestApplication extends Application {}
If you want to use a web.xml, you can instead of this class. If you do want to, just look for a tutorial to show you how to do it. But this class is all that is needed for the most basic configuration.
Upvotes: 1