我在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。我怎么能这样做?