cmailleux 2005/03/25 11:59:20 CET
Modified files:
war/src/java/com/codeva/webapps/webclipping/servlet
WebClippingServlet.java
war/src/java/com/codeva/webapps/webclipping Rewriter.java
war project.xml
Log:
Auto follwo redirects
Bug Correction
HttpClient 3.0-rc1
Revision Changes Path
1.3 +1 -1 webclipping/war/project.xml
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/webclipping/war/project.xml.diff?r1=1.2&r2=1.3&f=h
1.5 +5 -1
webclipping/war/src/java/com/codeva/webapps/webclipping/Rewriter.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/webclipping/war/src/java/com/codeva/webapps/webclipping/Rewriter.java.diff?r1=1.4&r2=1.5&f=h
1.4 +1 -0
webclipping/war/src/java/com/codeva/webapps/webclipping/servlet/WebClippingServlet.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/webclipping/war/src/java/com/codeva/webapps/webclipping/servlet/WebClippingServlet.java.diff?r1=1.3&r2=1.4&f=h
Index: WebClippingServlet.java
===================================================================
RCS file:
/home/cvs/repository/webclipping/war/src/java/com/codeva/webapps/webclipping/servlet/WebClippingServlet.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- WebClippingServlet.java 2 Mar 2005 09:23:19 -0000 1.3
+++ WebClippingServlet.java 25 Mar 2005 10:59:19 -0000 1.4
@@ -226,6 +226,7 @@
// Execute the method and check the status of the result
int statusCode = 0;
try {
+ httpMethod.setFollowRedirects(true);
statusCode = httpClient.executeMethod(httpMethod);
} catch (IOException e) {
StringBuffer buffer = new StringBuffer("<html>\n<body>");
Index: Rewriter.java
===================================================================
RCS file:
/home/cvs/repository/webclipping/war/src/java/com/codeva/webapps/webclipping/Rewriter.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Rewriter.java 17 Feb 2005 14:04:48 -0000 1.4
+++ Rewriter.java 25 Mar 2005 10:59:20 -0000 1.5
@@ -185,7 +185,11 @@
((urlProperties.getPort() >=
0) ? ":" +
urlProperties.getPort() : "");
- String absoluteUrl = s + urlProperties.getPath().substring(0,
urlProperties.getPath().lastIndexOf("/")) + '/' +
+ int endIndex = urlProperties.getPath().lastIndexOf("/");
+ if(endIndex < 0) {
+ endIndex = urlProperties.getPath().length()-1;
+ }
+ String absoluteUrl = s + urlProperties.getPath().substring(0,
endIndex) + '/' +
hrefUrl;
if (hrefUrl.trim().length() > 0) {
if(hrefUrl.startsWith("//")) {
Index: project.xml
===================================================================
RCS file: /home/cvs/repository/webclipping/war/project.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- project.xml 8 Dec 2004 17:03:31 -0000 1.2
+++ project.xml 25 Mar 2005 10:59:20 -0000 1.3
@@ -38,7 +38,7 @@
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
- <version>3.0-beta1</version>
+ <version>3.0-rc1</version>
<properties>
<war.bundle>true</war.bundle>
</properties>