Apache Struts API Documentation: Class BaseTag

Apache Struts API


org.apache.struts.taglib.html Class BaseTag

java.lang.Object
  |
  +--javax.servlet.jsp.tagext.TagSupport
        |
        +--org.apache.struts.taglib.html.BaseTag
All Implemented Interfaces:
java.io.Serializable, javax.servlet.jsp.tagext.Tag

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

Renders an HTML element with an href attribute pointing to the absolute location of the enclosing JSP page. This tag is only valid when nested inside a head tag body. The presence of this tag allows the browser to resolve relative URL's to images, CSS stylesheets and other resources in a manner independent of the URL used to call the ActionServlet.

Version:
$Rev: 54929 $ $Date: 2004-10-16 17:38:42 +0100 (Sat, 16 Oct 2004) $
See Also:
Serialized Form

Field Summary
protected static MessageResources messages
          The message resources for this package.
protected  java.lang.String server
          The server name to use instead of request.getServerName().
protected  java.lang.String target
          The target window for this base reference.
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext, parent, values
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
BaseTag()
           
 
Method Summary
 int doStartTag()
          Process the start of this tag.
 java.lang.String getServer()
          Returns the server.
 java.lang.String getTarget()
           
protected  java.lang.String renderBaseElement(java.lang.String scheme, java.lang.String serverName, int port, java.lang.String uri)
          Render a fully formed HTML <base> element and return it as a String.
 void setServer(java.lang.String server)
          Sets the server.
 void setTarget(java.lang.String target)
           
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doEndTag, 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, registerNatives, toString, wait, wait, wait
 

Field Detail

messages

protected static MessageResources messages
The message resources for this package.

server

protected java.lang.String server
The server name to use instead of request.getServerName().

target

protected java.lang.String target
The target window for this base reference.
Constructor Detail

BaseTag

public BaseTag()
Method Detail

getTarget

public java.lang.String getTarget()

setTarget

public void setTarget(java.lang.String target)

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
Process the start of this tag.
Overrides:
doStartTag in class javax.servlet.jsp.tagext.TagSupport
Throws:
javax.servlet.jsp.JspException - if a JSP exception has occurred

renderBaseElement

protected java.lang.String renderBaseElement(java.lang.String scheme,
                                             java.lang.String serverName,
                                             int port,
                                             java.lang.String uri)
Render a fully formed HTML <base> element and return it as a String.
Parameters:
scheme - The scheme used in the url (ie. http or https).
serverName -  
port -  
uri - The portion of the url from the protocol name up to the query string.
Returns:
String An HTML <base> element.
Since:
Struts 1.1

getServer

public java.lang.String getServer()
Returns the server.
Returns:
String

setServer

public void setServer(java.lang.String server)
Sets the server.
Parameters:
server - The server to set


Copyright © 2000-2005 - The Apache Software Foundation