Skip to Content.
Sympa Menu

perfsonar-dev - [GEANT/SA2/ps-java-services] r5660 - in trunk/servlet-context-redirector: . src src/main src/main/java src/main/java/net src/main/java/net/geant src/main/java/net/geant/perfsonar src/main/java/net/geant/perfsonar/filters src/main/webapp src/main/webapp/WEB-INF

Subject: perfsonar development work

List archive

[GEANT/SA2/ps-java-services] r5660 - in trunk/servlet-context-redirector: . src src/main src/main/java src/main/java/net src/main/java/net/geant src/main/java/net/geant/perfsonar src/main/java/net/geant/perfsonar/filters src/main/webapp src/main/webapp/WEB-INF


Chronological Thread 
  • From:
  • To:
  • Subject: [GEANT/SA2/ps-java-services] r5660 - in trunk/servlet-context-redirector: . src src/main src/main/java src/main/java/net src/main/java/net/geant src/main/java/net/geant/perfsonar src/main/java/net/geant/perfsonar/filters src/main/webapp src/main/webapp/WEB-INF
  • Date: Wed, 19 May 2010 15:41:15 +0100

Author: psnc.trzaszczka
Date: 2010-05-19 15:41:15 +0100 (Wed, 19 May 2010)
New Revision: 5660

Added:
trunk/servlet-context-redirector/pom.xml
trunk/servlet-context-redirector/src/
trunk/servlet-context-redirector/src/main/
trunk/servlet-context-redirector/src/main/java/
trunk/servlet-context-redirector/src/main/java/net/
trunk/servlet-context-redirector/src/main/java/net/geant/
trunk/servlet-context-redirector/src/main/java/net/geant/perfsonar/
trunk/servlet-context-redirector/src/main/java/net/geant/perfsonar/filters/

trunk/servlet-context-redirector/src/main/java/net/geant/perfsonar/filters/RedirectionFilter.java
trunk/servlet-context-redirector/src/main/resources/
trunk/servlet-context-redirector/src/main/webapp/
trunk/servlet-context-redirector/src/main/webapp/WEB-INF/
trunk/servlet-context-redirector/src/main/webapp/WEB-INF/web.xml
Log:


Added: trunk/servlet-context-redirector/pom.xml
===================================================================
--- trunk/servlet-context-redirector/pom.xml (rev
0)
+++ trunk/servlet-context-redirector/pom.xml 2010-05-19 14:41:15 UTC (rev
5660)
@@ -0,0 +1,66 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd";>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>net.geant.perfsonar</groupId>
+ <artifactId>servlet-context-redirector</artifactId>
+ <packaging>war</packaging>
+ <version>1.0</version>
+ <name>servlet-context-redirector Maven Webapp</name>
+ <url>http://maven.apache.org</url>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <finalName>servlet-context-redirector</finalName>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>6.1.10</version>
+ <configuration>
+
<scanIntervalSeconds>10</scanIntervalSeconds>
+ <stopKey>foo</stopKey>
+ <stopPort>9999</stopPort>
+ </configuration>
+ <executions>
+ <execution>
+ <id>start-jetty</id>
+
<phase>pre-integration-test</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+
<scanIntervalSeconds>0</scanIntervalSeconds>
+ <daemon>true</daemon>
+ </configuration>
+ </execution>
+ <execution>
+ <id>stop-jetty</id>
+
<phase>post-integration-test</phase>
+ <goals>
+ <goal>stop</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>

Added:
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
(rev 0)
+++
trunk/servlet-context-redirector/src/main/java/net/geant/perfsonar/filters/RedirectionFilter.java
2010-05-19 14:41:15 UTC (rev 5660)
@@ -0,0 +1,38 @@
+package net.geant.perfsonar.filters;
+
+import java.io.IOException;
+
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletResponse;
+
+public class RedirectionFilter implements Filter{
+
+ private final static String REDIRECT_URL_PARAM="redirectUrl";
+ private String redirectUrl;
+
+ @Override
+ public void destroy() {
+
+ }
+
+ @Override
+ public void doFilter(ServletRequest arg0, ServletResponse arg1,
+ FilterChain arg2) throws IOException,
ServletException {
+
+ HttpServletResponse response = (HttpServletResponse) arg1;
+ response.setHeader( "Location", "/"+redirectUrl );
+ response.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY);
+
+ }
+
+ @Override
+ public void init(FilterConfig arg0) throws ServletException {
+ redirectUrl=arg0.getInitParameter(REDIRECT_URL_PARAM);
+ }
+
+}

Added: trunk/servlet-context-redirector/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/servlet-context-redirector/src/main/webapp/WEB-INF/web.xml
(rev 0)
+++ trunk/servlet-context-redirector/src/main/webapp/WEB-INF/web.xml
2010-05-19 14:41:15 UTC (rev 5660)
@@ -0,0 +1,22 @@
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd"; >
+
+<web-app>
+ <display-name>Archetype Created Web Application</display-name>
+
+ <filter>
+ <filter-name>redirectionFilter</filter-name>
+
<filter-class>net.geant.perfsonar.filters.RedirectionFilter</filter-class>
+ <init-param>
+ <param-name>redirectUrl</param-name>
+ <param-value>perfsonar-java-xml-ls</param-value>
+ </init-param>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>redirectionFilter</filter-name>
+ <url-pattern>/</url-pattern>
+ </filter-mapping>
+
+</web-app>



  • [GEANT/SA2/ps-java-services] r5660 - in trunk/servlet-context-redirector: . src src/main src/main/java src/main/java/net src/main/java/net/geant src/main/java/net/geant/perfsonar src/main/java/net/geant/perfsonar/filters src/main/webapp src/main/webapp/WEB-INF, svn-noreply, 05/19/2010

Archive powered by MHonArc 2.6.16.

Top of Page