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

Reply via email to