com.cc.framework.taglib.util
Class BaseTag

java.lang.Object
  extended byjavax.servlet.jsp.tagext.TagSupport
      extended bycom.cc.framework.taglib.util.BaseTag
All Implemented Interfaces:
javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, java.io.Serializable, javax.servlet.jsp.tagext.Tag

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

Tag handler for the base tag. The <util:base> tag creates a html <base href="...."> element. The tag automatically sets the context root, so you can write <util:base> instead of <base href="http://localhost:8080/contextRoot/;"> if the context root of your application points to "contextRoot". The tag also sets automatically the used protocol (http, https). So you can deploy your application under differnt names, without changing the <base href="...."> element.

Since:
1.0
Version:
$Revision: 1.23 $
Author:
Gernot Schulz
See Also:
Serialized Form

Field Summary
private  java.lang.String contextPath
          ContextPath
private  java.lang.String host
          Host
private  java.lang.String port
          Portnumber
private static long serialVersionUID
          Serial Version UID
 
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
BaseTag()
          Constructor
 
Method Summary
 int doStartTag()
           
static java.lang.String getProtocol(javax.servlet.jsp.PageContext pageContext)
          Returns the Protocol used by the Application/WebServer
 void setContextPath(java.lang.String contextPath)
          Sets the ContextPath
 void setHost(java.lang.String host)
          Sets the Host
 void setPageContext(javax.servlet.jsp.PageContext arg0)
           
 void setPort(java.lang.String port)
          Sets the Portnumber
static void writeBase(javax.servlet.jsp.PageContext pageContext, java.lang.String host, java.lang.String port, java.lang.String contextPath)
          Writes the html base tag to the output
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Serial Version UID

See Also:
Constant Field Values

contextPath

private java.lang.String contextPath
ContextPath


port

private java.lang.String port
Portnumber


host

private java.lang.String host
Host

Constructor Detail

BaseTag

public BaseTag()
Constructor

Method Detail

setPageContext

public void setPageContext(javax.servlet.jsp.PageContext arg0)
See Also:
TagSupport.setPageContext(javax.servlet.jsp.PageContext)

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
Throws:
javax.servlet.jsp.JspException
See Also:
TagSupport.doStartTag()

writeBase

public static void writeBase(javax.servlet.jsp.PageContext pageContext,
                             java.lang.String host,
                             java.lang.String port,
                             java.lang.String contextPath)
Writes the html base tag to the output

Parameters:
pageContext - PageContext
host - Host
port - Portnumber
contextPath - ContextPath

getProtocol

public static java.lang.String getProtocol(javax.servlet.jsp.PageContext pageContext)
Returns the Protocol used by the Application/WebServer

Parameters:
pageContext - PageContext
Returns:
String protocol

setHost

public void setHost(java.lang.String host)
Sets the Host

Parameters:
host - Host

setPort

public void setPort(java.lang.String port)
Sets the Portnumber

Parameters:
port - Portnumber

setContextPath

public void setContextPath(java.lang.String contextPath)
Sets the ContextPath

Parameters:
contextPath - ContextPath


Copyright © 2000-2005 SCC Informationssysteme GmbH. All Rights Reserved.