我正在使用Eclipse和AppEngine SDK 1.7.5.
我试图在我的Google App Engine项目中验证war文件夹.我的web.xml存在无效内容:
Invalid content was found starting with element 'url-pattern'.
One of '{"http://java.sun.com/xml/ns/javaee":web-resource-name}'
is expected. web.xml /project/war/WEB-INF line 121 XML Problem
Run Code Online (Sandbox Code Playgroud)
这是错误引用的xml:
<security-constraint>
<web-resource-collection>
<url-pattern>/admin/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>admin</role-name>
</auth-constraint>
</security-constraint>
Run Code Online (Sandbox Code Playgroud)
如何修复错误?
这是一个重复,请参阅:我的web.xml中的Eclipse报告问题,但它处理得很好
无论如何,尝试添加web-resource-name元素,如下所示:
<web-resource-collection>
<web-resource-name>Admin Resources</web-resource-name>
<url-pattern>/admin/*</url-pattern>
</web-resource-collection>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1715 次 |
| 最近记录: |