1 25 26 package net.killingar.forum.tags; 27 28 import javax.servlet.jsp.JspException ; 29 30 public class RefreshContentsTag extends webwork.view.taglib.WebWorkTagSupport 31 { 32 public int doStartTag() throws JspException 33 { 34 try 35 { 36 String agent = ((javax.servlet.http.HttpServletRequest )pageContext.getRequest()).getHeader("User-Agent"); 37 38 Object o = getStack().findValue("showingUnread"); 39 40 if (o instanceof Boolean && ((Boolean )o).booleanValue() == true) 41 { 42 if (agent.indexOf("Gecko") == -1) pageContext.getOut().print(" onload=\"javascript:if (parent && parent.contents)parent.contents.history.go(0);\""); 44 else pageContext.getOut().print(" onload=\"javascript:if (parent && parent.contents)parent.contents.location.href='ViewContents.action';\""); 46 } 47 else 48 { 49 if (agent.indexOf("Gecko") == -1) 50 pageContext.getOut().print(" onload=\"javascript:if (parent && parent.contents)parent.contents.history.go(0); \""); 51 else 52 pageContext.getOut().print(" onload=\"javascript:if (parent && parent.contents)parent.contents.location.href='ViewContents.action'; \""); 53 } 54 } 55 catch (java.io.IOException e) 56 { 57 throw new JspException (e); 58 } 59 60 return SKIP_BODY; 61 } 62 63 public int doEndTag() 64 { 65 return EVAL_PAGE; 66 } 67 } 68 | Popular Tags |