Eclipse报告问题在我的web.xml中,但它处理得很好 [英] Eclipse reporting problem in my web.xml, but it is processed fine
问题描述
我在Eclipse中使用带有Google插件的Google App Engine,这里是我的web.xml的头文件:
$ b
<?xml version =1.0encoding =utf-8?>
< web-app xmlns:xsi =http://www.w3.org/2001/XMLSchema-instance
xmlns =http://java.sun.com/xml/ns / javaee
xmlns:web =http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd
xsi:schemaLocation =http://java.sun .com / xml / ns / javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsdversion =2.5>
基于一些GAE文档,我添加了这个:
< security-constraint>
< web-resource-collection>
< url-pattern> / tasks / *< / url-pattern>
< / web-resource-collection>
< auth-constraint>
<角色名称>管理员< /角色名称>
< / auth-constraint>
< / security-constraint>
然而Eclipse在url-pattern报告错误:
cvc-complex-type.2.4.a:发现以元素'url-pattern'开头的无效内容。
其中一个'{http: //blank.sun.com/xml/ns/javaee\":web-resource-name}'是预期的。
我可以启动应用程序,它似乎处理web.xml文件就好了,但我不喜欢Eclipse报告错误的事实。问题是什么?
嗯,这个错误看起来非常简单 - 它在url之前预期的web-resource-name标记-pattern:)
干杯
I'm using Google App Engine with the Google plugin in Eclipse, here is the header of my web.xml:
<?xml version="1.0" encoding="utf-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">
Based on some of the GAE documentation, I added this:
<security-constraint>
<web-resource-collection>
<url-pattern>/tasks/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>admin</role-name>
</auth-constraint>
</security-constraint>
However Eclipse reports an error at "url-pattern":
cvc-complex-type.2.4.a: Invalid content was found starting with element 'url-pattern'.
One of '{"http://java.sun.com/xml/ns/javaee":web-resource-name}' is expected.
I can start the app and it seems to process the web.xml file just fine, but I don't like the fact that Eclipse is reporting an error. What is the problem?
well, the error seems pretty straightforward - a web-resource-name tag it expected before the url-pattern :)
cheers
这篇关于Eclipse报告问题在我的web.xml中,但它处理得很好的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!