IntelliJ中缺少模式定义

时间:2015-02-05 17:12:56

标签: java xml intellij-idea xsd web.xml

更新到IntelliJ 14.0.3社区版我正在开发一个新的Web项目,但突然IntelliJ找不到最基本的模式定义了。以下是示例:http://i.stack.imgur.com/FVYld.pnghttp://i.stack.imgur.com/SboLZ.png

我试图'获取外部资源',但没有成功。

使用这种方法“JSF xmlns URI not registered in IntelliJ IDEA”我导入了web-facelettaglibrary_2_2.xsd,但是自动竞赛出错并且无用。

我试着让这个工作几个星期了,得到'URI未注册'和'无法解决符号'错误到处都是。 IntelliJ如何不知道这些URI完全超出我的范围。

有人可以帮助我让我心爱的汽车比赛重新开始并重新开始吗?

更新

我终于通过添加web-app_3_1.xsd以及它引用的每个文件及其引用来获得web-app模式,即:

  • javaee_7.xsd
  • javaee_web_services_client_1_4.xsd
  • jsp_2_3.xsd
  • 网络app_3_1.xsd
  • 网络common_3_1.xsd。

全部来自:hxxp://www.oracle.com/webfolder/technetwork/jsc/xml/ns/javaee/index.html

1 个答案:

答案 0 :(得分:4)

我尝试了同样的方法(防火墙阻止了所有IntelliJ的外部连接),这对我有用:

的web.xml

<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" version="3.1"></web-app>

的pom.xml

    <dependency>
        <groupId>javax</groupId>
        <artifactId>javaee-api</artifactId>
        <version>7.0</version>
    </dependency>

Java EE Schemas下载定义web-app_3_1.xsd。在IntelliJ中手动添加外部资源并选择刚刚下载的文件。您还可以在设置&gt;下看到它。语言与框架&gt;外部模式列表中的模式和DTD。

相关问题