org.apache.struts.taglib.html
Class HtmlTag

java.lang.Object
  extended byTagSupport
      extended byorg.apache.struts.taglib.html.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:
$Revision: 1.11 $ $Date: 2003/03/08 19:23:49 $
Author:
Craig R. McClanahan, David Graham
See Also:
Serialized Form

Field Summary
protected  boolean locale
          Should we set the current Locale for this user if needed?
protected static MessageResources messages
          The message resources for this package.
protected  boolean xhtml
          Are we rendering an xhtml page?
 
Constructor Summary
HtmlTag()
           
 
Method Summary
protected  java.util.Locale currentLocale()
          Deprecated. Use getCurrentLocale instead because it makes the display logic easier.
 int doEndTag()
          Process the end of this tag.
 int doStartTag()
          Process the start of this tag.
protected  java.util.Locale getCurrentLocale()
          Return the current Locale for this request.
 boolean getLocale()
           
 boolean getXhtml()
           
 void release()
          Release any acquired resources.
 void setLocale(boolean locale)
           
 void setXhtml(boolean xhtml)
           
 
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.


locale

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


xhtml

protected boolean xhtml
Are we rendering an xhtml page?

Constructor Detail

HtmlTag

public HtmlTag()
Method Detail

getLocale

public boolean getLocale()

setLocale

public void setLocale(boolean locale)

getXhtml

public boolean getXhtml()

setXhtml

public void setXhtml(boolean xhtml)

doStartTag

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

Throws:
JspException - if a JSP exception has occurred

doEndTag

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

Throws:
JspException - if a JSP exception has occurred

release

public void release()
Release any acquired resources.


currentLocale

protected java.util.Locale currentLocale()
Deprecated. Use getCurrentLocale instead because it makes the display logic easier.

Return the current Locale for this request, creating a new one if necessary. If there is no current Locale, and locale support is not requested, return null.


getCurrentLocale

protected java.util.Locale getCurrentLocale()
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


Copyright © 2000-2004 - Apache Software Foundation