Hi
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 "/".


There must be some way to make it work not only on Tomcat and Jetty but also on all servlet container, all of them are capable of handling redirects, it is something simple, some extra piece of info is missing in HttpServletRequestWrapper that CXF creates when redirecting to WebLogic dispatcher or some slash is missing, something like that.

Any chance you can create a simple test project with WebLogic ? Or experiment a bit more ? I think the stack overflow in the latter case is happening because CXFServlet is listening on /*, if it were a more restricted pattern which would not match JSP-targeted URIs then it would likely work better...However I'm interested what we can do to make it work with "/*" - that works OK with Tomcat/Jetty because they properly support named dispatchers (jsp, etc), but not with WebLogic...

Cheers, Sergey



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


Reply via email to