vmassol 2004/01/06 06:46:32
Modified: framework/src/java/share/org/apache/cactus/server
RequestDispatcherWrapper.java
documentation/docs/xdocs changes.xml
Log:
<action dev="VMA" type="fix">
Fixed the bug where a ServletException occurs, stating:
<code>The request object passed to forward() must be the request
object you got from your Cactus test case (i.e. a Cactus request
wrapper object). Instead we got [...]</code>.
</action>
Revision Changes Path
1.3 +22 -25
jakarta-cactus/framework/src/java/share/org/apache/cactus/server/RequestDispatcherWrapper.java
Index: RequestDispatcherWrapper.java
===================================================================
RCS file:
/home/cvs/jakarta-cactus/framework/src/java/share/org/apache/cactus/server/RequestDispatcherWrapper.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- RequestDispatcherWrapper.java 14 Jul 2003 08:17:25 -0000 1.2
+++ RequestDispatcherWrapper.java 6 Jan 2004 14:46:32 -0000 1.3
@@ -100,21 +100,20 @@
public void forward(ServletRequest theRequest, ServletResponse theResponse)
throws IOException, ServletException
{
- // If the request is not our request wrapper, then someone is doing
- // something wrong!
- if (!HttpServletRequestWrapper.class.isAssignableFrom(
+ // Always pass the original request to the forward() call.
+ if (HttpServletRequestWrapper.class.isAssignableFrom(
theRequest.getClass()))
{
- throw new ServletException("The request object passed to "
- + "forward() must be the request object you got from your "
- + "Cactus test case (i.e. a Cactus request wrapper object). "
+ "Instead we got [" + theRequest.getClass().getName() + "]");
- }
-
- HttpServletRequestWrapper request =
- (HttpServletRequestWrapper) theRequest;
+ HttpServletRequestWrapper request =
+ (HttpServletRequestWrapper) theRequest;
- this.originalDispatcher.forward(request.getOriginalRequest(),
- theResponse);
+ this.originalDispatcher.forward(request.getOriginalRequest(),
+ theResponse);
+ }
+ else
+ {
+ this.originalDispatcher.forward(theRequest, theResponse);
+ }
}
/**
@@ -130,21 +129,19 @@
public void include(ServletRequest theRequest, ServletResponse theResponse)
throws IOException, ServletException
{
- // If the request is not our request wrapper, then someone is doing
- // something wrong!
+ // Always pass the original request to the forward() call.
if (!HttpServletRequestWrapper.class.isAssignableFrom(
theRequest.getClass()))
{
- throw new ServletException("The request object passed to "
- + "include() must be the request object you got from your "
- + "Cactus test case (i.e. a Cactus request wrapper object). "
- + "Instead we got [" + theRequest.getClass().getName() + "]");
- }
+ HttpServletRequestWrapper request =
+ (HttpServletRequestWrapper) theRequest;
- HttpServletRequestWrapper request =
- (HttpServletRequestWrapper) theRequest;
-
- this.originalDispatcher.include(request.getOriginalRequest(),
- theResponse);
+ this.originalDispatcher.include(request.getOriginalRequest(),
+ theResponse);
+ }
+ else
+ {
+ this.originalDispatcher.include(theRequest, theResponse);
+ }
}
}
1.149 +6 -0 jakarta-cactus/documentation/docs/xdocs/changes.xml
Index: changes.xml
===================================================================
RCS file: /home/cvs/jakarta-cactus/documentation/docs/xdocs/changes.xml,v
retrieving revision 1.148
retrieving revision 1.149
diff -u -r1.148 -r1.149
--- changes.xml 30 Dec 2003 09:03:53 -0000 1.148
+++ changes.xml 6 Jan 2004 14:46:32 -0000 1.149
@@ -68,6 +68,12 @@
</devs>
<release version="1.6dev" date="in CVS">
+ <action dev="VMA" type="fix">
+ Fixed the bug where a ServletException occurs, stating:
+ <code>The request object passed to forward() must be the request
+ object you got from your Cactus test case (i.e. a Cactus request
+ wrapper object). Instead we got [...]</code>.
+ </action>
<action dev="VMA" type="add" fixes-bug="23016">
In the Ant integration module, added new <code>configXml</code>
attribute to the <code><weblogic7x></code> container
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]