org.apache.struts.taglib.html

Class 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: $Rev: 54929 $ $Date: 2004-10-16 17:38:42 +0100 (Sat, 16 Oct 2004) $

Field Summary
protected static MessageResourcesmessages
The message resources for this package.
protected Stringserver
The server name to use instead of request.getServerName().
protected Stringtarget
The target window for this base reference.
Method Summary
intdoStartTag()
Process the start of this tag.
StringgetServer()
Returns the server.
StringgetTarget()
protected StringrenderBaseElement(String scheme, String serverName, int port, String uri)
Render a fully formed HTML <base> element and return it as a String.
voidsetServer(String server)
Sets the server.
voidsetTarget(String target)

Field Detail

messages

protected static MessageResources messages
The message resources for this package.

server

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

target

protected String target
The target window for this base reference.

Method Detail

doStartTag

public int doStartTag()
Process the start of this tag.

Throws: JspException if a JSP exception has occurred

getServer

public String getServer()
Returns the server.

Returns: String

getTarget

public String getTarget()

renderBaseElement

protected String renderBaseElement(String scheme, String serverName, int port, 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

setServer

public void setServer(String server)
Sets the server.

Parameters: server The server to set

setTarget

public void setTarget(String target)
Copyright B) 2000-2008 - The Apache Software Foundation