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.JspTagException;
7 import javax.servlet.jsp.JspWriter;
8 import javax.servlet.jsp.tagext.BodyContent;
9 import javax.servlet.jsp.tagext.BodyTagSupport;
10 import java.io.IOException;
11
12 /***
13 * Created by IntelliJ IDEA.
14 * User: farra
15 * Date: Apr 4, 2003
16 * Time: 7:19:12 AM
17 * To change this template use Options | File Templates.
18 */
19 public class NoEventTag extends BodyTagSupport {
20
21
22
23 public int doStartTag() throws JspTagException {
24
25
26 CalendarSpan span = (CalendarSpan) pageContext.getAttribute("currentSpan");
27
28 CalendarEvent[] events = span.getEvents();
29
30 if( events.length > 0 ){
31 return SKIP_BODY;
32 }
33 else
34 return EVAL_BODY_BUFFERED;
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 }
This page was automatically generated by Maven