[
https://issues.jboss.org/browse/JBIDE-10645?page=com.atlassian.jira.plugi...
]
Viacheslav Kabanovich commented on JBIDE-10645:
-----------------------------------------------
I have found another way to deploy a JAX-RS application:
{code}
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_3_0.xsd" version="3.0">
<servlet>
<servlet-name>javax.ws.rs.core.Application</servlet-name>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>javax.ws.rs.core.Application</servlet-name>
<url-pattern>/rest/*</url-pattern>
</servlet-mapping>
</web-app>
{code}
which consistently follows the rule that servlet-mapping/servlet-name should reference a
name defined in servlet/servlet-name.
Why it may be important and/or acceptable to drop the servlet declaration as in the
example given in Description?
Validate servlet name 'javax.ws.rs.core.Application' or any
subtype
-------------------------------------------------------------------
Key: JBIDE-10645
URL:
https://issues.jboss.org/browse/JBIDE-10645
Project: Tools (JBoss Tools)
Issue Type: Bug
Components: JSF
Affects Versions: 3.3.0.M5
Reporter: Xavier Coulon
Assignee: Viacheslav Kabanovich
Labels: jax-rs, validation, web, web_xml
Fix For: 3.3.0.Beta1
The 'JAX-RS Application' is the top level fragment of the URI Path Templates of
the JAX-RS Endpoints.
One way to configure it is in the webapp's deployment descriptor, with something like
this:
{code}
<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<servlet-mapping>
<servlet-name>javax.ws.rs.core.Application</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>
{code}
see [JBossAS 7 / JAX-RS docs
here|https://docs.jboss.org/author/display/AS7/Java+API+for+RESTful+Web+S...]
Hélas, the web.xml validator reports an error (or a warning) with the following message
{quote}
servlet-name references to javax.ws.rs.core.Application that is not a servlet
{quote}
For sure, the validation level could be set to ignore, but could this JAX-RS specific
rule be implemented by default ?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira