KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opensymphony > webwork > views > jsp > ElseTag


1 /*
2  * Copyright (c) 2002-2003 by OpenSymphony
3  * All rights reserved.
4  */

5 package com.opensymphony.webwork.views.jsp;
6
7 import javax.servlet.jsp.JspException JavaDoc;
8
9
10 /**
11  * @author Rick Salsa (rsal@mb.sympatico.ca)
12  * @version $Revision: 1.3 $
13  */

14 public class ElseTag extends WebWorkTagSupport {
15     //~ Methods ////////////////////////////////////////////////////////////////
16

17     public int doStartTag() throws JspException JavaDoc {
18         Boolean JavaDoc ifResult = (Boolean JavaDoc) pageContext.getAttribute(IfTag.ANSWER);
19
20         pageContext.removeAttribute(IfTag.ANSWER);
21
22         if ((ifResult == null) || (ifResult.booleanValue() == true)) {
23             return SKIP_BODY;
24         } else {
25             return EVAL_BODY_INCLUDE;
26         }
27     }
28 }
29
Popular Tags