You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by SanekP <sa...@mail.ru> on 2014/02/17 22:08:27 UTC

JAX-RS overlaps access to static HTML

I have product.html file in my webapp folder and it works fine.
Then I add class with @Path("rest/product") annotation and REST works fine,
but I loss access to my product.html. In console when I try open
http://localhost:8080/app/product.html:
org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor processRequest
WARNING: No root resource matching request path product.html has been found,
Relative Path: /product.html. Please enable FINE/TRACE log level for more
details.

My web.xml pretty simple:
<web-app>
  <welcome-file-list>
    <welcome-file>product.html</welcome-file>
  </welcome-file-list>
</web-app>
What am I doing wrong? And how to setup url-prefix for JAX-RS?




--
View this message in context: http://openejb.979440.n4.nabble.com/JAX-RS-overlaps-access-to-static-HTML-tp4667855.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: JAX-RS overlaps access to static HTML

Posted by Romain Manni-Bucau <rm...@gmail.com>.
1) in openejb-jar.xml use cxf.jaxrs.static-resources-list =
index.html,another.html,my.css,...
2) don't get it since if you return an empty list of resource scanning
is used by spec
3) it works but need an init param IIRC

2014-02-17 22:56 UTC+01:00, SanekP <sa...@mail.ru>:
> 1. Can you explain how to use static-resources-list?
> 2. That's uncomfortable to have an extension of
> javax.ws.rs.core.Application
> because resources doesn't register automatically.
> 3. This web.xml not work for me:
>     <servlet>
>         <servlet-name>javax.ws.rs.core.Application</servlet-name>
>     </servlet>
>     <servlet-mapping>
>         <servlet-name>javax.ws.rs.core.Application</servlet-name>
>         <url-pattern>/rest/*</url-pattern>
>     </servlet-mapping>
>
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/JAX-RS-overlaps-access-to-static-HTML-tp4667855p4667857.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>


-- 
*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*

Re: JAX-RS overlaps access to static HTML

Posted by SanekP <sa...@mail.ru>.
1. Can you explain how to use static-resources-list?
2. That's uncomfortable to have an extension of javax.ws.rs.core.Application
because resources doesn't register automatically.
3. This web.xml not work for me:
    <servlet>
        <servlet-name>javax.ws.rs.core.Application</servlet-name>
    </servlet>
    <servlet-mapping>
        <servlet-name>javax.ws.rs.core.Application</servlet-name>
        <url-pattern>/rest/*</url-pattern>
    </servlet-mapping>




--
View this message in context: http://openejb.979440.n4.nabble.com/JAX-RS-overlaps-access-to-static-HTML-tp4667855p4667857.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: JAX-RS overlaps access to static HTML

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi

yes, often we map jaxrs under /api (use a jaxrs Application or web.xml
to do so). If you can't use
https://issues.apache.org/jira/browse/TOMEE-728

2014-02-17 22:08 UTC+01:00, SanekP <sa...@mail.ru>:
> I have product.html file in my webapp folder and it works fine.
> Then I add class with @Path("rest/product") annotation and REST works fine,
> but I loss access to my product.html. In console when I try open
> http://localhost:8080/app/product.html:
> org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor processRequest
> WARNING: No root resource matching request path product.html has been
> found,
> Relative Path: /product.html. Please enable FINE/TRACE log level for more
> details.
>
> My web.xml pretty simple:
> <web-app>
>   <welcome-file-list>
>     <welcome-file>product.html</welcome-file>
>   </welcome-file-list>
> </web-app>
> What am I doing wrong? And how to setup url-prefix for JAX-RS?
>
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/JAX-RS-overlaps-access-to-static-HTML-tp4667855.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>


-- 
*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*