1 16 17 package org.apache.taglibs.gnat; 18 19 import javax.servlet.jsp.*; 20 import javax.servlet.ServletContext ; 21 import javax.servlet.jsp.tagext.*; 22 import java.io.File ; 23 import java.io.FileWriter ; 24 import java.io.IOException ; 25 26 public class exitTag extends TagSupport 27 { 28 private String message=""; 29 private ServletContext ctx; 31 public void setMessage(String msg) 32 { 33 this.message = msg; 34 } 35 36 public String getMessage() 37 { 38 return message; 39 } 40 41 public int doEndTag() throws JspTagException 42 { 43 ctx = pageContext.getServletContext(); 44 if (message != null && message.length() > 0) 45 { 46 ctx.log("fail: "+message); 47 } 48 else 49 { 50 ctx.log("fail: No Message"); 51 } 52 return SKIP_PAGE; } 54 } 55 | Popular Tags |