栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

在没有插件web.xml问题的情况下配置Spring Security

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

在没有插件web.xml问题的情况下配置Spring Security

我在一段时间前完成了此工作,但在1.3中进行的设置与在1.2中进行的设置不同。我发现只能通过将外部XML文件添加到web.xml中的contextConfigLocation
context-param中来访问它们:

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

除此之外,该配置与非Grails应用程序的配置相同。您可能还需要配置jar。

另外,不要将jar复制到您的lib目录中,而应使用BuildConfig.groovy中的IVy配置,这样您的计算机上每个jar都只有一个副本。这是应该工作的一种:

grails.project.class.dir = 'target/classes'grails.project.test.class.dir = 'target/test-classes'grails.project.test.reports.dir = 'target/test-reports'grails.project.dependency.resolution = {   inherits 'global'   log 'warn'   repositories {      grailsPlugins()      grailsHome()      grailsCentral()      ebr() // SpringSource  http://www.springsource.com/repository   }   dependencies {      runtime('org.springframework.security:org.springframework.security.core:3.0.3.RELEASE') {         excludes 'com.springsource.org.aopalliance',       'com.springsource.org.apache.commons.logging',       'org.springframework.beans',       'org.springframework.context',       'org.springframework.core'      }      runtime('org.springframework.security:org.springframework.security.config:3.0.3.RELEASE')      runtime('org.springframework.security:org.springframework.security.web:3.0.3.RELEASE') {         excludes 'com.springsource.javax.servlet',       'com.springsource.org.aopalliance',       'com.springsource.org.apache.commons.logging',       'org.springframework.aop',       'org.springframework.beans',       'org.springframework.context',       'org.springframework.core',       'org.springframework.web'      }   }}


转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/375148.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号