不要在web.xml中添加spring-security.xml

时间:2016-08-14 10:14:21

标签: spring spring-mvc spring-security

为了在我的Web应用程序中实现安全性,我在web.xml的片段下面提供了过滤器DelegatingFilterProxy。是否可以将spring-security xml配置文件封装在模块中,例如基于maven的项目中的资源文件夹内。

我不想在 web.xml 中添加以下内容。

package amazontesting;

import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;

import java.io.FileNotFoundException;
import java.io.FileReader;

import java.io.IOException;
import java.util.Iterator;

public class json {
    private static final String filePath = /emp.json";
    public static void main(String[] args) {
        JSONParser parser = new JSONParser();
        try {
        Object obj = parser.parse(new FileReader(filePath));
        JSONObject jsonObject = (JSONObject) obj;
        String name = (String) jsonObject.get("Department");
        //String suites = (String) jsonObject.get("Company");


        JSONArray slideContent = (JSONArray) jsonObject.get("Department");
        Iterator i = slideContent.iterator();

        while (i.hasNext()) {
            System.out.println(i.next());
            String title = (String) jsonObject.get("Employee");
            System.out.println(title);
        }
    }
    catch (FileNotFoundException e)
    {}
    catch(IOException e)
    {}
    catch(ParseException e)
    {}

    }
}

我在spring-security.xml文件的片段下面提供了

<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/config/spring-security.xml</param-value>
  </context-param>

请在这方面帮助我。目标是仅将web.xml和安全模块中的DelegatingFilterProxy添加为jar文件。

0 个答案:

没有答案