开发常见bug故障列表
1.Spring “The prefix ”tx“ for element ”tx:annotation-driven“ is not bound.”
答案:
Just like your other xmlns: definations, you need one for xmlns:tx
xmlns:tx="http://www.springframework.org/schema/tx"
来源:stackoverflow
2.but no declaration can be found for element 'mvc:default-servlet-handler'.
答案:
问题的症结是在spring-mvc中有一个对静态资源所做的一个处理,但是在spring头文件中所引进的是用
xmlns:mvc="http://www.springframework.org/schema/cache"
而正确的处理应当是
xmlns:mvc="http://www.springframework.org/schema/mvc"
3.exception is java.lang.NoClassDefFoundError
这个问题最主要的是servletapi中有几个jar包没有添加进去,处理servlet需要用到的几个包如下
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>${javaee-api.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>1.1.2</version>
</dependency>