View Javadoc
1 package com.gotjava.web.taglibs.calendar; 2 3 import com.gotjava.model.calendar.CalendarSpan; 4 import com.gotjava.model.calendar.CalendarEvent; 5 6 import javax.servlet.jsp.tagext.BodyTagSupport; 7 import javax.servlet.jsp.tagext.BodyContent; 8 import javax.servlet.jsp.JspWriter; 9 import javax.servlet.jsp.JspTagException; 10 import java.util.Date; 11 import java.io.IOException; 12 13 14 /*** 15 * Created by IntelliJ IDEA. 16 * User: farra 17 * Date: Apr 3, 2003 18 * Time: 4:02:10 AM 19 * To change this template use Options | File Templates. 20 */ 21 public class HasEventTag extends BodyTagSupport { 22 23 24 25 public int doStartTag() throws JspTagException { 26 27 CalendarSpan span = (CalendarSpan) pageContext.getAttribute("currentSpan"); 28 29 CalendarEvent[] events = span.getEvents(); 30 31 if(events.length > 0) 32 return EVAL_BODY_BUFFERED; 33 else 34 return SKIP_BODY; 35 36 } 37 38 39 public int doAfterBody() 40 { 41 try 42 { 43 BodyContent body = getBodyContent(); 44 JspWriter out = body.getEnclosingWriter(); 45 out.println(body.getString()); 46 body.clearBody(); 47 } 48 catch (IOException ex) 49 { 50 } 51 return SKIP_BODY; 52 } 53 54 55 56 }

This page was automatically generated by Maven