## de.ix.jspTutorial.taglib
Class IfTag

    java.lang.Object
      |
      +--javax.servlet.jsp.tagext.TagSupport
            |
            +--de.ix.jspTutorial.taglib.IfTag

public class IfTag
extends javax.servlet.jsp.tagext.TagSupport

Simple If Condition statement example:

     <%@ taglib uri="/ixtaglib" prefix="jsptut" %>
     ...
      <jsptut:if expr="true">
        Hello here is the body
      </jsptut:if>
      <% boolean bool= false ; %>
      <jsptut:if expr="<%=bool%>">
        Never see it
      </jsptut:if>
     ...

Version:
  $Id:$
Author:
  Peter Rossbach (pr@webapp.de)
See Also:
  Serialized Form

Field Summary
`private boolean` `myExpression` Current Expression Value
`static java.lang.String` `vcid` Source-Version

Fields inherited from class javax.servlet.jsp.tagext.TagSupport
`id, pageContext, parent, values`

Constructor Summary
`IfTag()` set default Expression to true

Method Summary
`int` `doStartTag()` Check the Expression, is true include body
`protected boolean` `parseBoolean(java.lang.String aExpr, boolean aDefault)` Is the String aExpr true or yes
`void` `release()` Reset to Default
`void` `setExpr(boolean aExpr)` Set boolean expression Value.
`void` `setExpr(java.lang.Boolean aExpr)` Set Boolean expression Value.
`void` `setExpr(java.lang.String aExpr)` Set String expression Value and convert.

Methods inherited from class javax.servlet.jsp.tagext.TagSupport
`doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue`

Methods inherited from class java.lang.Object
`<clinit>, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait`

Field Detail

### vcid

    public static java.lang.String vcid

  Source-Version

### myExpression

    private boolean myExpression

  Current Expression Value

Constructor Detail

### IfTag

    public IfTag()

  set default Expression to true

Method Detail

### doStartTag

    public int doStartTag()
                   throws javax.servlet.jsp.JspTagException

  Check the Expression, is true include body
  Overrides:
    doStartTag in class javax.servlet.jsp.tagext.TagSupport
  Throws:
    javax.servlet.jsp.JspTagException -

### release

    public void release()

  Reset to Default
  Overrides:
    release in class javax.servlet.jsp.tagext.TagSupport

### setExpr

    public void setExpr(java.lang.Boolean aExpr)

  Set Boolean expression Value.
  Parameters:
    `aExpr` - set Expression

### setExpr

    public void setExpr(java.lang.String aExpr)

  Set String expression Value and convert.
  Parameters:
    `aExpr` - set Expression
  See Also:
    `parseBoolean(String,boolean)`

### setExpr

    public void setExpr(boolean aExpr)

  Set boolean expression Value.
  Parameters:
    `aExpr` - set Expression

### parseBoolean

    protected boolean parseBoolean(java.lang.String aExpr,
                                   boolean aDefault)

  Is the String aExpr true or yes
  Parameters:
    `aExpr` -
    `aDefault` -

~ Das iX JSP Tutorial III - © 2000 by Peter Roßbach ~