/** * Trampolin, forward requests to a different URL. *
* To find outgoing links from your website in your access.log, * replace all outgoing links: *
 *     http://foreignlink
 * 
* by something like *
 *     http://installedTrampolin?http://foreignlink
 * 
* It's so simple. */ package de.spieleck.servlets; import java.io.IOException; import javax.servlet.*; import javax.servlet.http.*; public class Trampolin extends HttpServlet { protected String prefix; public void init() throws ServletException { prefix = getInitParameter("prefix"); if ( prefix == null ) prefix = ""; System.err.println("FSN Trampolin: prefix='"+prefix+"'"); } public void service(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { String path = req.getQueryString(); if ( path == null ) { res.sendError( HttpServletResponse.SC_BAD_REQUEST ); return; } res.sendRedirect(prefix+path); } }