1 23 24 package org.dbforms.taglib; 25 26 import org.apache.commons.logging.Log; 27 import org.apache.commons.logging.LogFactory; 28 29 import javax.servlet.http.HttpServletResponse ; 30 import javax.servlet.jsp.JspException ; 31 32 33 34 71 public class DbRedirectURLTag extends DbLinkURLTag 72 implements javax.servlet.jsp.tagext.TryCatchFinally { 73 private static Log logCat = LogFactory.getLog(DbRedirectURLTag.class.getName()); 74 75 83 public int doBodyEndTag() throws javax.servlet.jsp.JspException { 84 return super.doBodyEndTag(); 85 } 86 87 88 91 public void doCatch(Throwable t) throws Throwable { 92 throw t; 93 } 94 95 96 104 public int doEndTag() throws javax.servlet.jsp.JspException { 105 try { 106 HttpServletResponse response = (HttpServletResponse ) pageContext 107 .getResponse(); 108 String s = makeUrl(); 109 s = response.encodeURL(s); 110 response.sendRedirect(s); 111 } catch (java.io.IOException ioe) { 112 throw new JspException ("IO Error: " + ioe.getMessage()); 113 } catch (Exception e) { 114 throw new JspException ("Error: " + e.getMessage()); 115 } 116 117 return SKIP_PAGE; 118 } 119 120 121 124 public void doFinally() { 125 logCat.info("doFinally called"); 126 super.doFinally(); 127 } 128 129 130 132 141 public int doStartTag() throws javax.servlet.jsp.JspException { 142 return super.doStartTag(); 143 } 144 } 145 | Popular Tags |