【发布时间】:2014-04-28 18:18:30
【问题描述】:
我的插件定义文件中有以下代码:
def doWithWebDescriptor = { xml ->
// Implement additions to web.xml (optional), this event occurs before
xml.'welcome-file-list'[0] + {
'security-constraint'({
'web-resource-collection'({
'web-resource-name'('Java Melody Monitoring')
'url-pattern'('/monitoring')
})
'auth-constraint'({
'role-name'('melody')
})
})
'login-config'({
'auth-method'('BASIC')
'realm-name'('Restricted Area')
})
}
}
这会将“security-constraint”和“login-config”节点添加到 web.xml 文件中,但是,我目前已将其硬编码为添加到“welcome-file-list”节点之后。我想不通的是如何简单地告诉它添加这些节点作为“web-app”根节点中的最后一个节点。
【问题讨论】: