vmassol 01/08/30 05:18:12
Modified: cactus/docs/framework/xdocs howto_config.xml
Log:
add trailing "/" to URLs so that HttpURLConnection does not handle status code > 400
as errors and throw a FileNotFoundException
Revision Changes Path
1.2 +24 -6 jakarta-commons/cactus/docs/framework/xdocs/howto_config.xml
Index: howto_config.xml
===================================================================
RCS file: /home/cvs/jakarta-commons/cactus/docs/framework/xdocs/howto_config.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- howto_config.xml 2001/08/16 09:58:36 1.1
+++ howto_config.xml 2001/08/30 12:18:12 1.2
@@ -86,7 +86,7 @@
<strong>Example</strong>
</td>
<td>
- <code>http://localhost:8080/test/ServletRedirector</code>
+ <code>http://localhost:8080/test/ServletRedirector/</code>
</td>
</tr>
</table>
@@ -117,7 +117,7 @@
<strong>Example</strong>
</td>
<td>
- <code>http://localhost:8080/test/JspRedirector</code>
+ <code>http://localhost:8080/test/JspRedirector/</code>
</td>
</tr>
</table>
@@ -138,10 +138,19 @@
# that you use for your application. In the example below, the context is
# "test".
-cactus.servletRedirectorURL = http://localhost:8080/test/ServletRedirector
-cactus.jspRedirectorURL = http://localhost:8080/test/JspRedirector
+cactus.servletRedirectorURL = http://localhost:8080/test/ServletRedirector/
+cactus.jspRedirectorURL = http://localhost:8080/test/JspRedirector/
]]></source>
+ <note>
+ Notice the trailing slash ("/") to Redirector URLs. This is
+ because Cactus uses the JDK <code>HttpURLConnection</code> class
+ to connect to these URLs and if your code on the server side
+ returns an HTTP status code greater than 400,
+ <code>HttpURLConnection</code> will return an exception. It does
+ not if the URL ends with a forward slash ("/") !
+ </note>
+
</s3>
<s3 title="log_client.properties">
@@ -260,16 +269,25 @@
<servlet-mapping>
<servlet-name>ServletRedirector</servlet-name>
- <url-pattern>/ServletRedirector</url-pattern>
+ <url-pattern>/ServletRedirector/</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>JspRedirector</servlet-name>
- <url-pattern>/JspRedirector</url-pattern>
+ <url-pattern>/JspRedirector/</url-pattern>
</servlet-mapping>
</web-app>
]]></source>
+
+ <note>
+ Notice the trailing slash ("/") to Redirector mappings. This is
+ because Cactus uses the JDK <code>HttpURLConnection</code> class
+ to connect to these URLs and if your code on the server side
+ returns an HTTP status code greater than 400,
+ <code>HttpURLConnection</code> will return an exception. It does
+ not if the URL ends with a forward slash ("/") !
+ </note>
<note>
If you are using the JSP Redirector (i.e. you have test classes