com.ora.jsp.tags
Class MenuItemTag

java.lang.Object
  extended byjavax.servlet.jsp.tagext.SimpleTagSupport
      extended bycom.ora.jsp.tags.MenuItemTag
All Implemented Interfaces:
javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.SimpleTag

public class MenuItemTag
extends javax.servlet.jsp.tagext.SimpleTagSupport

This class is a custom action for conditionally inserting HTML links in a navigation menu.

If the action is used in a page requested with a URL corresponding to the page attribute, only the HTML text is included. Otherwise an HTML link (<a>...</a>) element is used to enclose the HTML text. The action also "URL rewrites" the page URL (embeds a session ID, if needed).

Version:
3.0
Author:
Hans Bergsten, Gefion software

Field Summary
private  java.lang.String page
           
 
Fields inherited from class javax.servlet.jsp.tagext.SimpleTagSupport
 
Constructor Summary
MenuItemTag()
           
 
Method Summary
 void doTag()
          Writes either the body content as-is or enclosed in an HTML link element to the current JspWriter, depending on if the request URI matches the page attribute value or not.
 void setPage(java.lang.String page)
          Sets the page attribute.
 
Methods inherited from class javax.servlet.jsp.tagext.SimpleTagSupport
findAncestorWithClass, getJspBody, getJspContext, getParent, setJspBody, setJspContext, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

page

private java.lang.String page
Constructor Detail

MenuItemTag

public MenuItemTag()
Method Detail

setPage

public void setPage(java.lang.String page)
Sets the page attribute.

Parameters:
page - the page URI value

doTag

public void doTag()
           throws javax.servlet.jsp.JspException,
                  java.io.IOException
Writes either the body content as-is or enclosed in an HTML link element to the current JspWriter, depending on if the request URI matches the page attribute value or not. The content is enclosed in an HTML link element (<a>...</a>) if the page attribute doesn't correspond to the current page and the link is "URL rewritten" (a session ID is added, if needed), and the result is written to the current JspWriter.

Throws:
javax.servlet.jsp.JspException
java.io.IOException