org.apache.struts.taglib.html
Class BaseTag

java.lang.Object
  extended byTagSupport
      extended byorg.apache.struts.taglib.html.BaseTag

public class BaseTag
extends 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:
$Revision: 1.22 $ $Date: 2004/03/14 06:23:46 $
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.
 
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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, 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 JspException
Process the start of this tag.

Throws:
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-2009 - The Apache Software Foundation