• 大小: 11KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-05-04
  • 语言: Java
  • 标签:

资源简介

这个非常简单,很多功能都没有实现,不是新手请不要去下载。

资源截图

代码片段和文件信息

package filter;

import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public  class characterEncodingFilter implements Filter {

private FilterConfig config;
public void destroy() {
}
@Override
public void doFilter(ServletRequest request ServletResponse response FilterChain chain)
throws IOException ServletException {
    request.setCharacterEncoding(config.getInitParameter(“charset“));
    HttpServletRequest hrequest = (HttpServletRequest)request;
    HttpServletResponse hresponse = (HttpServletResponse)response; 
    String LoginUser = (String)hrequest.getSession().getAttribute(“LoginUser“);
    //告诉服务器已经处理完毕
    chain.doFilter(request response);
}
@Override
public void init(FilterConfig config) throws ServletException {
   this.config=config;
}
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件         842  2018-09-28 16:43  FilterDemo\.classpath
     文件        1043  2018-09-28 16:43  FilterDemo\.project
     目录           0  2018-09-28 19:11  FilterDemo\.settings\
     文件         567  2018-09-28 16:43  FilterDemo\.settings\.jsdtscope
     文件          57  2018-09-28 19:11  FilterDemo\.settings\org.eclipse.core.resources.prefs
     文件         364  2018-09-28 16:43  FilterDemo\.settings\org.eclipse.jdt.core.prefs
     文件         482  2018-09-28 16:43  FilterDemo\.settings\org.eclipse.wst.common.component
     文件         345  2018-09-28 16:43  FilterDemo\.settings\org.eclipse.wst.common.project.facet.core.xml
     文件          49  2018-09-28 16:43  FilterDemo\.settings\org.eclipse.wst.jsdt.ui.superType.container
     文件           6  2018-09-28 16:43  FilterDemo\.settings\org.eclipse.wst.jsdt.ui.superType.name
     目录           0  2018-09-28 16:43  FilterDemo\build\
     目录           0  2018-09-29 10:05  FilterDemo\build\classes\
     目录           0  2018-09-29 10:05  FilterDemo\build\classes\filter\
     文件        1827  2018-09-29 20:28  FilterDemo\build\classes\filter\characterEncodingFilter.class
     目录           0  2018-09-29 10:05  FilterDemo\build\classes\Model\
     文件         702  2018-09-29 10:05  FilterDemo\build\classes\Model\Message.class
     目录           0  2018-09-28 20:14  FilterDemo\src\
     目录           0  2018-09-28 20:18  FilterDemo\src\filter\
     文件        1120  2018-09-29 20:28  FilterDemo\src\filter\characterEncodingFilter.java
     目录           0  2018-09-28 17:06  FilterDemo\src\Model\
     文件         340  2018-09-28 18:53  FilterDemo\src\Model\Message.java
     目录           0  2018-09-28 17:15  FilterDemo\WebContent\
     文件        2130  2018-09-28 16:45  FilterDemo\WebContent\form.css
     文件        1002  2018-09-29 20:50  FilterDemo\WebContent\index.jsp
     文件         438  2018-09-28 21:17  FilterDemo\WebContent\login.jsp
     文件        1645  2018-09-29 20:28  FilterDemo\WebContent\message.jsp
     文件         776  2018-09-28 19:49  FilterDemo\WebContent\messageSub.jsp
     目录           0  2018-09-28 16:43  FilterDemo\WebContent\meta-INF\
     文件          39  2018-09-28 16:43  FilterDemo\WebContent\meta-INF\MANIFEST.MF
     文件         563  2018-09-28 16:44  FilterDemo\WebContent\table.css
     目录           0  2018-09-28 16:43  FilterDemo\WebContent\WEB-INF\
............此处省略2个文件信息

评论

共有 条评论