1 25 26 package net.killingar.forum.tags; 27 28 import net.killingar.forum.internal.managers.ForumManager; 29 import net.killingar.forum.internal.managers.OptionsManager; 30 31 import javax.servlet.http.HttpServletRequest ; 32 import javax.servlet.jsp.JspException ; 33 import javax.servlet.jsp.tagext.TagSupport ; 34 35 public class HrTag extends TagSupport 36 { 37 public int doStartTag() throws JspException 38 { 39 try 40 { 41 ForumManager manager = (ForumManager)pageContext.getSession().getAttribute("manager"); 42 String tmp; 43 if(manager == null || (tmp = ((OptionsManager)manager.getManager(OptionsManager.class.getName())).get("hr")) == null) 44 pageContext.getOut().print("<img SRC=\""+((HttpServletRequest )pageContext.getRequest()).getContextPath()+"/public/img/color.gif\" width=\"100%\" height=\"13\" alt=\"---\"/><br />"); 45 else 46 pageContext.getOut().print(tmp); 47 } 48 catch (Exception ex) 49 { 50 try 51 { 52 pageContext.getOut().print("<hr />"); 53 } 54 catch (Exception ex2){} 55 } 56 return SKIP_BODY; 57 } 58 59 public int doEndTag() 60 { 61 return EVAL_PAGE; 62 } 63 } 64 | Popular Tags |