【问题标题】:How to configure url-pattern under security domain in web.xml from java at runtime?如何在运行时从 java 在 web.xml 中的安全域下配置 url-pattern?
【发布时间】:2017-11-17 06:51:48
【问题描述】:

我在web.xml 中配置了安全域:

<security-constraint>
    <display-name>all</display-name>
        <web-resource-collection>
            <web-resource-name>all</web-resource-name>
            <url-pattern>${param-name</url-pattern>
            <http-method>POST</http-method>
            <http-method>GET</http-method>
            <http-method>PUT</http-method>
            <http-method>DELETE</http-method>
            <http-method>PATCH</http-method>
        </web-resource-collection>
        <auth-constraint>
        <role-name>admin</role-name>
    </auth-constraint>
</security-constraint>

现在我想在服务器启动时在运行时从 java 设置 url-pattern。我该怎么做?

【问题讨论】:

    标签: java spring jboss web.xml


    【解决方案1】:

    参考java doc设置url-pattern

    【讨论】:

      猜你喜欢
      • 2013-09-25
      • 2018-08-06
      • 1970-01-01
      • 2013-05-11
      • 1970-01-01
      • 2012-01-29
      • 2020-03-27
      • 2011-01-29
      相关资源
      最近更新 更多