• 大小: 11.9MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-07-29
  • 语言: 其他
  • 标签: springmvc  restful  

资源简介

完整的IntelliJ IDEA项目,使用springmvc实现resrful风格的api,增删改次完整

资源截图

代码片段和文件信息

package com.websystique.springmvc.configuration;

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.HttpServletResponse;


public class CORSFilter implements Filter {

    public void doFilter(ServletRequest req ServletResponse res FilterChain chain) throws IOException ServletException {
        System.out.println(“Filtering on...........................................................“);
        HttpServletResponse response = (HttpServletResponse) res;
        response.setHeader(“Access-Control-Allow-Origin“ “*“);
        response.setHeader(“Access-Control-Allow-Methods“ “POST GET PUT OPTIONS DELETE“);
        response.setHeader(“Access-Control-Max-Age“ “3600“);
        response.setHeader(“Access-Control-Allow-Headers“ “x-requested-with“);
        //response.setHeader(“Access-Control-Allow-Headers“ “Origin No-Cache X-Requested-With If-Modified-Since Pragma Last-Modified Cache-Control Expires Content-Type X-E4M-WithuserIdtoken“);
        //response.setHeader(“Access-Control-Allow-Credentials“ “true“);
        //response.setHeader(“XDomainRequestAllowed““1“);
        chain.doFilter(req res);
    }

    public void init(FilterConfig filterConfig) {
    }

    public void destroy() {
    }

}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-01-09 10:01  Spring4MVCCRUDRestService\
     目录           0  2018-01-09 17:48  Spring4MVCCRUDRestService\.idea\
     目录           0  2018-01-07 14:45  Spring4MVCCRUDRestService\.idea\artifacts\
     文件         341  2018-01-07 14:45  Spring4MVCCRUDRestService\.idea\artifacts\Spring4MVCCRUDRestService_war.xml
     文件        2348  2018-01-07 14:45  Spring4MVCCRUDRestService\.idea\artifacts\Spring4MVCCRUDRestService_war_exploded.xml
     文件         662  2018-01-07 14:45  Spring4MVCCRUDRestService\.idea\compiler.xml
     目录           0  2018-01-15 18:01  Spring4MVCCRUDRestService\.idea\inspectionProfiles\
     目录           0  2018-01-07 14:45  Spring4MVCCRUDRestService\.idea\libraries\
     文件         514  2018-01-07 14:45  Spring4MVCCRUDRestService\.idea\libraries\Maven__aopalliance_aopalliance_1_0.xml
     文件         644  2018-01-07 14:45  Spring4MVCCRUDRestService\.idea\libraries\Maven__com_fasterxml_jackson_core_jackson_annotations_2_5_0.xml
     文件         595  2018-01-07 14:45  Spring4MVCCRUDRestService\.idea\libraries\Maven__com_fasterxml_jackson_core_jackson_core_2_5_3.xml
     文件         623  2018-01-07 14:45  Spring4MVCCRUDRestService\.idea\libraries\Maven__com_fasterxml_jackson_core_jackson_databind_2_5_3.xml
     文件         558  2018-01-07 14:45  Spring4MVCCRUDRestService\.idea\libraries\Maven__commons_logging_commons_logging_1_2.xml
     文件         578  2018-01-07 14:45  Spring4MVCCRUDRestService\.idea\libraries\Maven__javax_servlet_javax_servlet_api_3_1_0.xml
     文件         609  2018-01-07 14:45  Spring4MVCCRUDRestService\.idea\libraries\Maven__org_springframework_spring_aop_4_2_0_RELEASE.xml
     文件         623  2018-01-07 14:45  Spring4MVCCRUDRestService\.idea\libraries\Maven__org_springframework_spring_beans_4_2_0_RELEASE.xml
     文件         637  2018-01-07 14:45  Spring4MVCCRUDRestService\.idea\libraries\Maven__org_springframework_spring_context_4_2_0_RELEASE.xml
     文件         616  2018-01-07 14:45  Spring4MVCCRUDRestService\.idea\libraries\Maven__org_springframework_spring_core_4_2_0_RELEASE.xml
     文件         658  2018-01-07 14:45  Spring4MVCCRUDRestService\.idea\libraries\Maven__org_springframework_spring_expression_4_2_0_RELEASE.xml
     文件         602  2018-01-07 14:45  Spring4MVCCRUDRestService\.idea\libraries\Maven__org_springframework_spring_tx_4_2_0_RELEASE.xml
     文件         609  2018-01-07 14:45  Spring4MVCCRUDRestService\.idea\libraries\Maven__org_springframework_spring_web_4_2_0_RELEASE.xml
     文件         630  2018-01-07 14:45  Spring4MVCCRUDRestService\.idea\libraries\Maven__org_springframework_spring_webmvc_4_2_0_RELEASE.xml
     文件         566  2018-01-07 14:45  Spring4MVCCRUDRestService\.idea\misc.xml
     文件         290  2018-01-07 14:44  Spring4MVCCRUDRestService\.idea\modules.xml
     文件       51867  2018-01-09 17:48  Spring4MVCCRUDRestService\.idea\workspace.xml
     文件        2852  2018-01-09 10:01  Spring4MVCCRUDRestService\Spring4MVCCRUDRestService.iml
     文件        2169  2018-01-07 14:44  Spring4MVCCRUDRestService\pom.xml
     目录           0  2018-01-07 14:44  Spring4MVCCRUDRestService\src\
     目录           0  2018-01-07 14:45  Spring4MVCCRUDRestService\src\main\
     目录           0  2018-01-07 14:45  Spring4MVCCRUDRestService\src\main\java\
     目录           0  2018-01-07 14:45  Spring4MVCCRUDRestService\src\main\java\com\
............此处省略96个文件信息

评论

共有 条评论