1 18 19 package org.apache.struts.taglib.html; 20 21 import java.net.MalformedURLException ; 22 import java.util.Map ; 23 24 import javax.servlet.jsp.JspException ; 25 26 import org.apache.struts.taglib.TagUtils; 27 28 33 public class RewriteTag extends LinkTag { 34 35 36 38 39 44 public int doStartTag() throws JspException { 45 46 Map params = TagUtils.getInstance().computeParameters 48 (pageContext, paramId, paramName, paramProperty, paramScope, 49 name, property, scope, transaction); 50 51 String url = null; 52 try { 53 url = 56 TagUtils.getInstance().computeURLWithCharEncoding( 57 pageContext, 58 forward, 59 href, 60 page, 61 action, 62 module, 63 params, 64 anchor, 65 false, 66 this.isXhtml(), 67 useLocalEncoding); 68 69 } catch (MalformedURLException e) { 70 TagUtils.getInstance().saveException(pageContext, e); 71 throw new JspException 72 (messages.getMessage("rewrite.url", e.toString())); 73 } 74 75 TagUtils.getInstance().write(pageContext, url); 76 77 return (SKIP_BODY); 78 79 } 80 81 82 83 88 public int doEndTag() throws JspException { 89 90 return (EVAL_PAGE); 91 92 } 93 94 95 } 96 | Popular Tags |