1 20 package org.enhydra.barracuda.plankton.http; 21 22 import javax.servlet.*; 23 import javax.servlet.http.*; 24 25 26 29 public class URLRewriter { 30 31 40 public static boolean REWRITE_URLS = true; 41 43 54 public static String encodeURL(HttpServletRequest req, HttpServletResponse resp, String url) { 55 if (REWRITE_URLS && resp != null) { 58 return resp.encodeURL(url); 59 } 60 return url; 61 } 62 63 74 public static String encodeRedirectURL(HttpServletRequest req, HttpServletResponse resp, String url) { 75 if (REWRITE_URLS && resp != null) { 78 return resp.encodeRedirectURL(url); 79 } 80 return url; 81 } 82 83 } 84 | Popular Tags |