1 24 package org.riotfamily.website.filter; 25 26 import java.io.IOException ; 27 28 import javax.servlet.FilterChain ; 29 import javax.servlet.RequestDispatcher ; 30 import javax.servlet.ServletException ; 31 import javax.servlet.ServletRequest ; 32 import javax.servlet.ServletResponse ; 33 34 import org.springframework.web.filter.GenericFilterBean; 35 36 60 public class ForwardToServletFilter extends GenericFilterBean { 61 62 private String servletName; 63 64 public void setServletName(String servletName) { 65 this.servletName = servletName; 66 } 67 68 public void doFilter(ServletRequest request, 69 ServletResponse response, FilterChain filterChain) 70 throws IOException , ServletException { 71 72 RequestDispatcher rd = getServletContext().getNamedDispatcher(servletName); 73 rd.forward(request, response); 74 } 75 76 } 77 | Popular Tags |