|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.elasticpath.commons.filter.impl.EncodingFilter
public final class EncodingFilter
Currently, many browsers do not send character encoding information in the Content-Type header of an HTTP request. If an encoding has not been specified by the client request, the container uses a default encoding to parse request parameters. If the client hasn't set the character encoding and the request parameters are encoded with a different encoding than the default, the parameters will be parsed incorrectly. You can use the method setCharacterEncoding in the ServletRequest interface to set the encoding. Since this method must be called prior to parsing any post data or reading any input from the request, this function is a prime application for filters.
Constructor Summary | |
---|---|
EncodingFilter()
|
Method Summary | |
---|---|
void |
destroy()
Called by the web container to indicate to a filter that it is being taken out of service. |
void |
doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain)
The doFilter method of the Filter is called by the container each time a request/response pair is passed through the chain due to a client request for a resource at the end of the chain. |
void |
init(javax.servlet.FilterConfig filterConfig)
Called by the web container to indicate to a filter that it is being placed into service. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EncodingFilter()
Method Detail |
---|
public void destroy()
destroy
in interface javax.servlet.Filter
public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) throws javax.servlet.ServletException, EpLicensingInvalidException, EpLicensingMissingException
doFilter
in interface javax.servlet.Filter
request
- -the requestresponse
- -the responsechain
- - the filter chain
javax.servlet.ServletException
- - if something goes wrong
EpLicensingInvalidException
- - if license is invalid
EpLicensingMissingException
- - if license is missingpublic void init(javax.servlet.FilterConfig filterConfig)
init
in interface javax.servlet.Filter
filterConfig
- - the filerConfig.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |