简体   繁体   English

Web片段与Maven

[英]Web fragments with maven

I've just discovered web fragments and I'd like to use them in my pluggable application. 我刚刚发现了Web片段,并希望在可插拔应用程序中使用它们。 Basically I'm building a plugin which will contain the security part of my app (based on Spring security). 基本上,我正在构建一个插件,其中将包含我应用程序的安全性部分(基于Spring安全性)。 The web fragment contains only the servlet filter: Web片段仅包含servlet过滤器:

<!-- Loads the security fragment first -->
<ordering>
    <before>
        <others />
    </before>
</ordering>

<!-- Spring security filter -->
<filter>
    <filter-name>springSecurityFilterChain</filter-name>
    <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
    <filter-name>springSecurityFilterChain</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

The problem is that it's not working at all. 问题在于它根本不起作用。 The filter works fine if I test it in the main app but if I put it here I'm not intercepting any call. 如果我在主应用程序中对其进行测试,则该过滤器可以正常工作,但如果将其放在此处,则不会拦截任何呼叫。 I think it may be caused by the maven build. 我认为这可能是由Maven构建引起的。 I'm packaging the project as a jar because I've read around to do so. 我将项目打包为jar,因为我已经读过了。 The web-fragment.xml is under /bin/META-INF/. web-fragment.xml在/ bin / META-INF /下。

Can anyone explain me what I'm doing wrong? 谁能解释我在做什么错?

Thank you. 谢谢。

将您的Web片段放在src\\main\\resources\\META-INF\\web-fragment.xml

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM