org.apache.struts.taglib.html

Class HtmlTag

public class HtmlTag extends TagSupport

Renders an HTML element with appropriate language attributes if there is a current Locale available in the user's session.

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

Field Summary
protected booleanlang
Are we rendering a lang attribute?
protected booleanlocale
Should we set the current Locale for this user if needed?
protected static MessageResourcesmessages
The message resources for this package.
protected booleanxhtml
Are we rendering an xhtml page?
Method Summary
intdoEndTag()
Process the end of this tag.
intdoStartTag()
Process the start of this tag.
protected LocalegetCurrentLocale()
Return the current Locale for this request.
booleangetLang()
Returns true if the tag should render a lang attribute.
booleangetLocale()
booleangetXhtml()
voidrelease()
Release any acquired resources.
protected StringrenderHtmlStartElement()
Renders an <html> element with appropriate language attributes.
voidsetLang(boolean lang)
Sets whether the tag should render a lang attribute.
voidsetLocale(boolean locale)
voidsetXhtml(boolean xhtml)

Field Detail

lang

protected boolean lang
Are we rendering a lang attribute?

Since: Struts 1.2

locale

protected boolean locale

Deprecated: This will be removed after Struts 1.2.

Should we set the current Locale for this user if needed?

messages

protected static MessageResources messages
The message resources for this package.

xhtml

protected boolean xhtml
Are we rendering an xhtml page?

Method Detail

doEndTag

public int doEndTag()
Process the end of this tag.

Throws: JspException if a JSP exception has occurred

doStartTag

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

Throws: JspException if a JSP exception has occurred

getCurrentLocale

protected Locale getCurrentLocale()

Deprecated: This will be removed after Struts 1.2.

Return the current Locale for this request. If there is no locale in the session and the locale attribute is set to "true", this method will create a Locale based on the client's Accept-Language header or the server's default locale and store it in the session. This will always return a Locale and never null.

Since: Struts 1.1

getLang

public boolean getLang()
Returns true if the tag should render a lang attribute.

Since: Struts 1.2

getLocale

public boolean getLocale()

Deprecated: This will be removed after Struts 1.2.

getXhtml

public boolean getXhtml()

release

public void release()
Release any acquired resources.

renderHtmlStartElement

protected String renderHtmlStartElement()
Renders an <html> element with appropriate language attributes.

Since: Struts 1.2

setLang

public void setLang(boolean lang)
Sets whether the tag should render a lang attribute.

Since: Struts 1.2

setLocale

public void setLocale(boolean locale)

Deprecated: This will be removed after Struts 1.2.

setXhtml

public void setXhtml(boolean xhtml)
Copyright B) 2000-2009 - The Apache Software Foundation