perfsonar-dev - [GEANT/SA2/ps-java-services] r5667 - in trunk/servlet-context-redirector/src: main/java/net/geant/perfsonar/filters main/webapp/WEB-INF test/java/net/geant/perfsonar/filters
Subject: perfsonar development work
List archive
[GEANT/SA2/ps-java-services] r5667 - in trunk/servlet-context-redirector/src: main/java/net/geant/perfsonar/filters main/webapp/WEB-INF test/java/net/geant/perfsonar/filters
Chronological Thread
- From:
- To:
- Subject: [GEANT/SA2/ps-java-services] r5667 - in trunk/servlet-context-redirector/src: main/java/net/geant/perfsonar/filters main/webapp/WEB-INF test/java/net/geant/perfsonar/filters
- Date: Thu, 20 May 2010 10:02:31 +0100
Author: psnc.trzaszczka
Date: 2010-05-20 10:02:31 +0100 (Thu, 20 May 2010)
New Revision: 5667
Modified:
trunk/servlet-context-redirector/src/main/java/net/geant/perfsonar/filters/RedirectionFilter.java
trunk/servlet-context-redirector/src/main/webapp/WEB-INF/web.xml
trunk/servlet-context-redirector/src/test/java/net/geant/perfsonar/filters/RedirectionFilterTestCase.java
Log:
Modified:
trunk/servlet-context-redirector/src/main/java/net/geant/perfsonar/filters/RedirectionFilter.java
===================================================================
---
trunk/servlet-context-redirector/src/main/java/net/geant/perfsonar/filters/RedirectionFilter.java
2010-05-20 08:56:47 UTC (rev 5666)
+++
trunk/servlet-context-redirector/src/main/java/net/geant/perfsonar/filters/RedirectionFilter.java
2010-05-20 09:02:31 UTC (rev 5667)
@@ -8,6 +8,7 @@
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class RedirectionFilter implements Filter{
@@ -23,9 +24,10 @@
@Override
public void doFilter(ServletRequest arg0, ServletResponse arg1,
FilterChain arg2) throws IOException,
ServletException {
+ HttpServletRequest request=(HttpServletRequest)arg0;
+ HttpServletResponse response = (HttpServletResponse) arg1;
- HttpServletResponse response = (HttpServletResponse) arg1;
- response.setHeader( "Location", "/"+redirectUrl );
+ response.setHeader( "Location", "/"+redirectUrl +
request.getServletPath());
response.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY);
}
Modified: trunk/servlet-context-redirector/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/servlet-context-redirector/src/main/webapp/WEB-INF/web.xml
2010-05-20 08:56:47 UTC (rev 5666)
+++ trunk/servlet-context-redirector/src/main/webapp/WEB-INF/web.xml
2010-05-20 09:02:31 UTC (rev 5667)
@@ -16,7 +16,7 @@
<filter-mapping>
<filter-name>redirectionFilter</filter-name>
- <url-pattern>/</url-pattern>
+ <url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
Modified:
trunk/servlet-context-redirector/src/test/java/net/geant/perfsonar/filters/RedirectionFilterTestCase.java
===================================================================
---
trunk/servlet-context-redirector/src/test/java/net/geant/perfsonar/filters/RedirectionFilterTestCase.java
2010-05-20 08:56:47 UTC (rev 5666)
+++
trunk/servlet-context-redirector/src/test/java/net/geant/perfsonar/filters/RedirectionFilterTestCase.java
2010-05-20 09:02:31 UTC (rev 5667)
@@ -13,7 +13,7 @@
public class RedirectionFilterTestCase extends TestCase {
private final String
SERVICE_URL="http://localhost:8080/servlet-context-redirector";
- private final String REDIRECTION_CONTEXT="perfsonar-java-xml-ls";
+ private final String REDIRECTION_CONTEXT="perfsonar-java-xml-ls/";
public void testRedirection() throws IOException {
- [GEANT/SA2/ps-java-services] r5667 - in trunk/servlet-context-redirector/src: main/java/net/geant/perfsonar/filters main/webapp/WEB-INF test/java/net/geant/perfsonar/filters, svn-noreply, 05/20/2010
Archive powered by MHonArc 2.6.16.