【发布时间】:2014-03-28 16:01:42
【问题描述】:
我的程序(Java 6,Spring 3.2.4.)运行良好,但是当我将“mvc:annotation-driven”添加到我的 Spring XML 时,它崩溃了。我需要 Hibernate Validator 所以我需要那个命令。我想知道为什么我的其他注释(@RequestMapping、@Controller 等)正在工作。
Spring-base.xml:
<?xml version="1.0" encoding="UTF-8"?>
<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"
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">
<context:component-scan base-package="testing" />
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/Jsp/" />
<property name="suffix" value=".jsp" />
</bean>
<mvc:annotation-driven />
</beans>
控制台说:
The module has not been deployed.
See the server log for details.
at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:238)
at org.netbeans.modules.maven.j2ee.ExecutionChecker.performDeploy(ExecutionChecker.java:205)
at org.netbeans.modules.maven.j2ee.ExecutionChecker.executionResult(ExecutionChecker.java:123)
at org.netbeans.modules.maven.execute.MavenCommandLineExecutor.run(MavenCommandLineExecutor.
java:235)
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153)
当我停止服务器(Glassfish 4.0)并调试时:什么都没有。
当我清理和构建时:
Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean (default-
clean) on project ProjectDB: Failed to clean project: Failed to delete C:\Users
\USER\Documents\NetBeansProjects\ProjectDB\target\ProjectDB-1.0-SNAPSHOT\WEB-INF
\lib\spring-web-3.2.4.RELEASE.jar -> [Help 1]
我不明白发生了什么。
【问题讨论】:
-
您缺少
mvc命名空间声明。 -
谢谢!现在工作,该死的这些菜鸟错误。
标签: java spring maven spring-mvc annotations