]
Dmitrii Bocharov updated JBIDE-13578:
-------------------------------------
Fix Version/s: 4.5.x
(was: 4.4.x)
Provide quickfixes to existing JAX-RS Application
-------------------------------------------------
Key: JBIDE-13578
URL:
https://issues.jboss.org/browse/JBIDE-13578
Project: Tools (JBoss Tools)
Issue Type: Feature Request
Components: webservices
Affects Versions: 4.0.0.Final
Reporter: Xavier Coulon
Assignee: Xavier Coulon
Labels: jax-rs
Fix For: 4.5.x
A quickfix to annotate the JAX-RS Application with javax.ws.rs.ApplicationPath should be
provided if an error is detected.
----
From JAX-RS 1.1 spec, chap 2.3.2:
When using the pluggability mechanism the following conditions MUST be met:
• If no Application subclass is present the added servlet MUST be named:
javax.ws.rs.core.Application
and all root resource classes and providers packaged in the web application MUST be
included in the published JAX-RS application. The application MUST be packaged with a
web.xml that specifies a servlet mapping for the added servlet.
• If an Application subclass is present and there is already a servlet defined that has a
servlet initial- ization parameter named:
javax.ws.rs.Application
whose value is the fully qualified name of the Application subclass then no new servlet
should be added by the JAX-RS implementation’s ContainerInitializer since the application
is already being handled by an existing servlet.
• If an Application subclass is present that is not being handled by an existing servlet
then the servlet added by the ContainerInitializer MUST be named with the fully qualified
name of the Application subclass. If the Application subclass is annotated with
@ApplicationPath and no servlet-mapping exists for the added servlet then a new servlet
mapping is added with the value of the @ApplicationPath annotation with ”/*” appended
otherwise the existing mapping is used. If the Application subclass is not annotated with
@ApplicationPath then the application MUST be packaged with a web.xml that specifies a
servlet mapping for the added servlet. It is an error for more than one application to be
deployed at the same effective servlet mapping