当前位置: 首页 > 工具软件 > revise > 使用案例 >

Filter Chain in J2EE : revise response header

郑旭
2023-12-01
<filter>
        <filter-name>CharacterEncoding</filter-name>
        <filter-class>com.ebay.filter.ResponseHeaderOverride</filter-class>
        
    </filter>
    <filter-mapping>
        <filter-name>CharacterEncoding</filter-name>
        <url-pattern>*</url-pattern>
    </filter-mapping>


With above configurations defined in web.xml, in our customized filter, we only need to write several lines of code in doFilter() method:

res.setContentType("text/html;charset=UTF-8");
filterChain.doFilter(req, res);


 类似资料:

相关阅读

相关文章

相关问答