Java Eclipse无法解析Spring3MVC模式
我正在使用Spring3.2.6并尝试使用标签。问题是Eclipse似乎无法找到mvc名称空间。 以下是我的XML:Java Eclipse无法解析Spring3MVC模式,java,eclipse,spring,spring-mvc,Java,Eclipse,Spring,Spring Mvc,我正在使用Spring3.2.6并尝试使用标签。问题是Eclipse似乎无法找到mvc名称空间。 以下是我的XML: <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/mvc/spring-mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd">
我尝试过不使用“”版本,但仍然不起作用。
Eclipse无法自动完成“mvc”。如果我尝试运行它,我会得到一个“cvc复杂类型.2.4.c:匹配的通配符是严格的,但是找不到元素“mvc:annotation-driven.”的声明”错误,我在谷歌上搜索了这个错误,但没有多少帮助
aop和上下文前缀可以完成,我的类路径中有spring-webmvc-3.2.6.jar。
非常感谢您的帮助。您好,Alexx我想您的mvc xsi:schemaLocation有问题 更改<代码>http://www.springframework.org/schema/mvc/spring-mvc到
http://www.springframework.org/schema/mvc
试试这个:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd">
我建议您使用STS,它将节省您的时间
这是我目前在我的应用程序中使用的…我建议您检查是否在某个公司防火墙后面,该防火墙可能会阻止eclipse检查远程xsd资源。不,不是这样。我可以看到窗口>首选项>网络连接>缓存中列出的模式。谢谢,它可以工作。我以前真的应该看过。我想我有隧道视力。有时候最好是一个人呆一会儿,不客气。如果答案有效,请接受它,这样可以帮助他人轻松找到正确答案……:)
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">