Anyframe Web

anyframe.web.struts.filter
Class CharacterEncodingFilter

java.lang.Object
  extended by anyframe.web.struts.filter.CharacterEncodingFilter
All Implemented Interfaces:
javax.servlet.Filter

public class CharacterEncodingFilter
extends java.lang.Object
implements javax.servlet.Filter

The class implementing anyframe.web.struts.filter Changes the encoding of parameter value with respect to the encoding value configured in web.xml

web.xml configuration method

 <servlet>
                <servlet-name>action</servlet-name>
                <servlet-class>
                        anyframe.web.struts.common.action.DefaultActionServlet
                </servlet-class>
                <init-param>
                        <param-name>config</param-name>
                        <param-value>
                                /config/struts/struts-config-common.xml
                        </param-value>
                </init-param>
                <init-param>
             <param-name>character-encoding</param-name>
             <param-value>utf-8</param-value>
      </init-param>
 </servlet>
 

Author:
Sooyeon Park

Constructor Summary
CharacterEncodingFilter()
           
 
Method Summary
 void destroy()
           
 void doFilter(javax.servlet.ServletRequest req, javax.servlet.ServletResponse res, javax.servlet.FilterChain chain)
           
 void init(javax.servlet.FilterConfig config)
           
 void setEncoding(java.lang.String encoding)
           
 void setForceEncoding(boolean forceEncoding)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CharacterEncodingFilter

public CharacterEncodingFilter()
Method Detail

setEncoding

public void setEncoding(java.lang.String encoding)

setForceEncoding

public void setForceEncoding(boolean forceEncoding)

init

public void init(javax.servlet.FilterConfig config)
Specified by:
init in interface javax.servlet.Filter

doFilter

public void doFilter(javax.servlet.ServletRequest req,
                     javax.servlet.ServletResponse res,
                     javax.servlet.FilterChain chain)
              throws java.io.IOException,
                     javax.servlet.ServletException
Specified by:
doFilter in interface javax.servlet.Filter
Throws:
java.io.IOException
javax.servlet.ServletException

destroy

public void destroy()
Specified by:
destroy in interface javax.servlet.Filter

Anyframe Web

Copyright © 2008-2009 Samsung SDS. All Rights Reserved.