FileDocCategorySizeDatePackage
RequestEncodingSupport.javaAPI DocGlassfish v2 API4442Sat May 05 19:17:52 BST 2007org.apache.taglibs.standard.tag.common.fmt

RequestEncodingSupport

public abstract class RequestEncodingSupport extends javax.servlet.jsp.tagext.TagSupport
Support for tag handlers for <requestEncoding>, the tag for setting the request character encoding in JSTL 1.0.
author
Jan Luehe
author
Pierre Delisle

Fields Summary
static final String
REQUEST_CHAR_SET
private static final String
DEFAULT_ENCODING
protected String
value
protected String
charEncoding
Constructors Summary
public RequestEncodingSupport()

   // derived from 'value' attribute  
    

    //*********************************************************************
    // Constructor and initialization

      
	super();
	init();
    
Methods Summary
public intdoEndTag()

        charEncoding = value;
	if ((charEncoding == null)
	        && (pageContext.getRequest().getCharacterEncoding() == null)) { 
            // Use charset from session-scoped attribute
	    charEncoding = (String)
		pageContext.getAttribute(REQUEST_CHAR_SET,
					 PageContext.SESSION_SCOPE);
	    if (charEncoding == null) {
		// Use default encoding
		charEncoding = DEFAULT_ENCODING;
	    }
	}

	/*
	 * If char encoding was already set in the request, we don't need to 
	 * set it again.
	 */
	if (charEncoding != null) {
	    try {
		pageContext.getRequest().setCharacterEncoding(charEncoding);
	    } catch (UnsupportedEncodingException uee) {
		throw new JspTagException(uee.toString(), uee);
	    }
	}

	return EVAL_PAGE;
    
private voidinit()

	value = null;
    
public voidrelease()

	init();