Hi Paul
I have tried to modify CXFServlet listening on '/' to block if it is a
/WEB-INF/* pathImfo which is being processed now, but I've observed what you
did. Basically, when a RequestDispatcherProvider forwards, the first servlet
which gets this forward request is the same CXFServlet so blocking it just
results in the original forward request being blocked and thus an empty
response is returned.
So here is what can be done here :
1. add
<property name="dispatcherName" value="jsp"/>
to
<bean id="dispatchProvider1"
class="org.apache.cxf.jaxrs.provider.RequestDispatcherProvider">
<property name="resourcePath" value="/WEB-INF/jsp/test.jsp"/>
<property name="scope" value="request"/>
</bean>
it will restrict the space a bit and will exclude CXFServlet from a list of
candidates, as far as RequestDispatcher.forward(...) is concerned.
I have tried it from Eclipse, though I will need to update it to ensure JDK but
not JRE is used by default for JSP pages be compiled...But CXFServlet is
definitely bypassed.
2. If it is feasible to make your jsp pages public by moving them one level
higher from /WEB-INF, say to /jsp/..., then configuring CXFServlet to redirect
to /jsp/test.jsp will do the trick. What will happen is that
RequestDispatcherProvider will forward and CXFServlet will forward it
further... I think the reason it could not forward to /WEB-INF was that private
resources under /WEB-INF are not visible at the CXFServlet level...
hope it helps, can you please try one of the above options ?
thanks, Sergey
-----Original Message-----
From: Paul Wilton [mailto:[email protected]]
Sent: Tue 1/5/2010 10:01 AM
To: Sergey Beryozkin
Cc: [email protected]
Subject: RE: another question on RequestDispatcherProvider
Hi Sergey
I have tried extending the CXFServlet and overriding the redirect method
as you suggest. But the response is empty by that time -
By the time redirect method is invoked has the CXFServlet already
intercepted the .jsp request and created a new Response (discarding the
one generated when the JSP was initially processed by the servlet
container) ?