LOL, it has 3 such servlet declarations, not 2. I'm confused :-)
Still the examples are straightforward IMHO. Check the example showing a redirect for all the html pages...

Sergey
On 29/04/15 12:18, Sergey Beryozkin wrote:
Well, I've mentioned which servlet parameters need to be checked. The
web.xml has 4 servlet declarations, only 2 of them have these
parameters. What exactly is confusing ?


On 29/04/15 12:06, Voss, Marko wrote:
Hi Sergey,

to be honest, those are multiple examples at once, aren't they? This
is confusing for me...


-----Ursprüngliche Nachricht-----
Von: Sergey Beryozkin [mailto:sberyoz...@gmail.com]
Gesendet: Mittwoch, 29. April 2015 12:28
An: users@cxf.apache.org
Betreff: Re: AW: AW: AW: AW: How to forward requests to a JSP page
when using CXFNonSpringJaxrsServlet

Hi Marko
On 29/04/15 10:44, Voss, Marko wrote:
Hi Sergey,

You can control by configuring CXFServlet with init parameters that
would let it know that a default servlet needs to take care of all
of .css files, set a redirect init parameter there Does it help ?

Well, I do not know, how to set this up for the
CXFNonSpringJaxrsServlet. I can see a parameter named
'jaxrs.static.subresources' in that class, but I highly doubt, that
this is the same. Can you show me an example, of how to do this, please?

See for example

https://git-wip-us.apache.org/repos/asf?p=cxf.git;a=blob;f=systests/jaxrs/src/test/resources/jaxrs_dispatch/WEB-INF/web.xml;h=a2212337bd6a9ed7a212b21a6826850581601121;hb=HEAD


(redirect-list, redirect-servlet-name parameters) - redirect to a
'default' or other servlet name representing a default servlet.

It is only needed if you have a wildcard URL pattern for CXFServlet
because it obviously catches all the requests...

Cheers, Sergey





Thank you very much.

Best regards,
Marko

-----Ursprüngliche Nachricht-----
Von: Sergey Beryozkin [mailto:sberyoz...@gmail.com]
Gesendet: Donnerstag, 23. April 2015 13:55
An: users@cxf.apache.org
Betreff: Re: AW: AW: AW: How to forward requests to a JSP page when
using CXFNonSpringJaxrsServlet

Hi Marko

On 23/04/15 07:48, Voss, Marko wrote:
Hi Sergey,

I am running into a different issue with this. The forwarding calls
a JSP, which requires a stylesheet.

The JAXRS service, which is performing the forwarding is located at:

/appcontext/rest/service

The JSP is located at:

/appcontext/foo.jsp

The stylesheet will be loaded from:

/appcontext/rest/css/stylesheet.css

Instead of:

/appcontext/css/stylesheet.css

What entity loads this stylesheet, JSP ? Using a "/css/stylesheet.css"
relative to a base HTTP address ?
So CXF endpoint is at "/appcontext/rest" base address and I think
this base address is used when forwarding. CXF does not know that
given a JSP reference such as "/appcontext/css/stylesheet.css" it
needs to use "/appcontext" only as a base address.
Well, JSP can just use a context value only, instead of the base HTTP
address that CXF sets up. I.e, use Servlet API in JSP to get the
context and + "css/stylesheet.css" to it.


Even if I put the stylesheet into a rest folder, it does not work,
because the JAXRS servlet, "thinks" it has to handle a rest service
request.

You can control by configuring CXFServlet with init parameters that
would let it know that a default servlet needs to take care of all of
.css files, set a redirect init parameter there


Does it help ?

Cheers, Sergey

Why is the stylesheet loaded like this? How can I avoid this behavior?


Thank you in advance and best regards,

Marko





--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Reply via email to