By the way, I did not even had to do this trick when restricting the CXFServlet pattern for it not to 'cover' the URIs pointing to JSPs

Sergey

On 30/12/11 18:45, Sergey Beryozkin wrote:
Hi

This trick,

<servlet>
 >>> <servlet-name>jsp</servlet-name>
 >>> <servlet-class>weblogic.servlet.JSPServlet</servlet-class>
 >>> </servlet>

Did it for me on WebLogic Server 12c (12.1.1),
with CXFServlet using a wildcard "/*" pattern.

Please try the latest 2.4.x or CXF 2.5.1, I'm testing with CXF
2.5.2-SNAPSHOT.

I've deployed the OAuth demo we ship in the Talend distro which has a
lot of JSP pages, they are located under /forms relative to the root of
the webapp, all works OK

I'm going to document the tricks one need to be aware of when deploying
CXF JAX-RS applications into various appservers, so thanks for your tip too

Sergey

On 09/11/11 18:31, Nikolay Aleksiev wrote:
Hi,

I tried your suggestion, but the results are not good.

In both servers I get to StackOverflowError because of endless
redirection. I tried setting redirect-servlet-path to both "" and "/".

Cheers,
Nikolay



On 11/09/2011 07:31 PM, Sergey Beryozkin wrote:
Hi

On 09/11/11 16:28, Nikolay Aleksiev wrote:
Hi,

I have the following CXF Servlet configuration:

<!-- CXF Servlet -->
<servlet>
<servlet-name>CXFServlet</servlet-name>
<servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>


<!-- Redirect all JSP requests to the default jsp servlet -->
<init-param>
<param-name>redirects-list</param-name>
<param-value>.*\.jsp</param-value>
</init-param>
<init-param>
<param-name>redirect-servlet-name</param-name>
<param-value>jsp</param-value>
</init-param>
<!-- Serve static content -->
<init-param>
<param-name>static-resources-list</param-name>
<param-value>.*\.html .*\.htm .*\.js .*\.css</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>CXFServlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>

As you can see my servlet is matching all requests that's why I must
handle JSPs and static contact. The above config works like charm on
Tomcat. Unfortunately I need my application both on Tomcat and
Weblogic.
After looking into
org.apache.cxf.transport.servlet.AbstractHTTPServlet,
I found out that with WbLogic servlet context, there's no request
dispatcher for the name JSP. So I tried adding the following servlet to
my web.xml:
<servlet>
<servlet-name>jsp</servlet-name>
<servlet-class>weblogic.servlet.JSPServlet</servlet-class>
</servlet>

With this additional config the request is endlessly redirected to the
same servlet (weblogic.servlet.JSPServlet) and I end with
StackOverflowError which is catched in AbstractHTTPServlet.

So I can mark the following problems:
1. I can not serve JSPs with redirect, on WebLogic...

2. I can't make the application work on both WL and Tomcat. Even If I
can add some servlet config for weblogic (hopefully issue 1 will be
solved), then I will need two separate web.xml configs for weblogic and
tomcat.


Can you please try using a "redirect-servlet-path" instead of
redirect-servlet-name property and set to "" ? Looking at the code,
what should happen in this case is that a dispatcher for "" +
"/my.jsp" should be checked instead,

let me know please if it helps

Cheers, Sergey


I hope someone will have any ideas how can I proceed.

Regards,
Nikolay





--
Sergey Beryozkin

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

Blog: http://sberyozkin.blogspot.com

Reply via email to