com.windgazer.util.io.taglib
Class FileTag

java.lang.Object
  |
  +--javax.servlet.jsp.tagext.TagSupport
        |
        +--com.windgazer.util.io.taglib.FileTag
All Implemented Interfaces:
FileProvider, javax.servlet.jsp.tagext.IterationTag, java.io.Serializable, javax.servlet.jsp.tagext.Tag

public class FileTag
extends javax.servlet.jsp.tagext.TagSupport
implements FileProvider

This Tag opens a file, embedded tags should be used to display any information associated with it. By default opens the jsp-file in which it is embedded. Alternate file may be supplied by calling the setName method. If no filename is set and no HttpServletRequest can be found the site-root becomes the default file.

Version:
1.1
Author:
Martin 'Kemanorel' Reurings.
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
FileTag()
          Default constructor, all subclasses are required to only define a public constructor with the same signature, and to call the superclass constructor.
 
Method Summary
 int doAfterBody()
          Implementation of the BodyTagSupport Class.
 int doEndTag()
          Implementation of the BodyTagSupport Class.
 int doStartTag()
          Implementation of the BodyTagSupport Class.
 java.io.File getFile()
          Implementation of the FileProvider interface.
 void setName(java.lang.String myName)
          Setter to be called when the name property of this tag is invoked.
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileTag

public FileTag()
Default constructor, all subclasses are required to only define a public constructor with the same signature, and to call the superclass constructor.

Method Detail

setName

public void setName(java.lang.String myName)
Setter to be called when the name property of this tag is invoked. If a null value is given current file will be opened instead.

Parameters:
myName - The value of the filename that this tag should open.

getFile

public java.io.File getFile()
Implementation of the FileProvider interface.

Specified by:
getFile in interface FileProvider
Returns:
The file that's being processed.
See Also:
FileProvider.getFile()

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspTagException
Implementation of the BodyTagSupport Class. Will look for a HttpServlet Request if the filename is still null. If found current file will be opened if not found root will be openend.

Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class javax.servlet.jsp.tagext.TagSupport
Returns:
EVAL_BODY_INCLUDE
javax.servlet.jsp.JspTagException

doAfterBody

public int doAfterBody()
                throws javax.servlet.jsp.JspTagException
Implementation of the BodyTagSupport Class.

Specified by:
doAfterBody in interface javax.servlet.jsp.tagext.IterationTag
Overrides:
doAfterBody in class javax.servlet.jsp.tagext.TagSupport
Returns:
SKIP_BODY
javax.servlet.jsp.JspTagException

doEndTag

public int doEndTag()
             throws javax.servlet.jsp.JspException
Implementation of the BodyTagSupport Class. Resets some of the information, stored in this tag, to their default values.

Specified by:
doEndTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doEndTag in class javax.servlet.jsp.tagext.TagSupport
Returns:
super.doEndTag()
javax.servlet.jsp.JspException


Copyright © 2003 Windgazer Design. All Rights Reserved.