- java.lang.Object
-
- com.aoapps.encoding.servlet.EncodingContextEE
-
- All Implemented Interfaces:
EncodingContext
public class EncodingContextEE extends Object implements EncodingContext
Encoding being done within a servlet context.- Author:
- AO Industries, Inc.
-
-
Field Summary
-
Fields inherited from interface com.aoapps.encoding.EncodingContext
DEFAULT, SGML, XML
-
-
Constructor Summary
Constructors Constructor Description EncodingContextEE(Doctype doctype, Serialization serialization, Charset characterEncoding, HttpServletResponse response)Uses the provided doctype, serialization, and character encoding.EncodingContextEE(ServletContext servletContext, HttpServletRequest request, HttpServletResponse response)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringencodeURL(String url)CharsetgetCharacterEncoding()DoctypegetDoctype()SerializationgetSerialization()
-
-
-
Constructor Detail
-
EncodingContextEE
public EncodingContextEE(Doctype doctype, Serialization serialization, Charset characterEncoding, HttpServletResponse response)
Uses the provided doctype, serialization, and character encoding.Changes on request or response will not be detected and should not be done. Please ensure doctype, serialization, and encoding are all set on the request and response.
-
EncodingContextEE
public EncodingContextEE(ServletContext servletContext, HttpServletRequest request, HttpServletResponse response)
The values forDoctype,Serialization, andCharsetare only looked-up once and cached.Changes on request or response will not be detected and should not be done. Please ensure doctype, serialization, and encoding are all set on the request and response.
-
-
Method Detail
-
encodeURL
public String encodeURL(String url)
Encodes the URL via
URIEncoder.encodeURI(java.lang.String)thenHttpServletResponse.encodeURL(java.lang.String).- Specified by:
encodeURLin interfaceEncodingContext
-
getDoctype
public Doctype getDoctype()
Uses the cached value from construction time.
- Specified by:
getDoctypein interfaceEncodingContext
-
getSerialization
public Serialization getSerialization()
Uses the cached value from construction time.
- Specified by:
getSerializationin interfaceEncodingContext
-
getCharacterEncoding
public Charset getCharacterEncoding()
Uses the cached value from construction time.
- Specified by:
getCharacterEncodingin interfaceEncodingContext
-
-