1 18 19 package cowsultants.itracker.web.taglib; 20 21 import javax.servlet.*; 22 import javax.servlet.http.*; 23 import javax.servlet.jsp.JspException ; 24 import javax.servlet.jsp.tagext.TagSupport ; 25 26 import org.apache.struts.Globals; 27 import org.apache.struts.action.*; 28 29 public final class ClearErrorsTag extends TagSupport { 30 private String name = Globals.ERROR_KEY; 31 32 public String getName() { 33 return name; 34 } 35 36 public void setName(String value) { 37 name = value; 38 } 39 40 public int doStartTag() throws JspException { 41 return (SKIP_BODY); 42 } 43 44 public int doEndTag() throws JspException { 45 ActionErrors errors = null; 46 HttpSession session = pageContext.getSession(); 47 48 if(session == null) { 49 return EVAL_PAGE; 50 } 51 52 try { 53 session.removeAttribute(getName()); 54 } catch(ClassCastException cce) { 55 } 56 return EVAL_PAGE; 57 } 58 59 public void release() { 60 super.release(); 61 name = Globals.ERROR_KEY; 62 } 63 } 64 | Popular Tags |