1.
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/wangzhaogl-application.xml,/WEB-INF/wangzhaogl-persistence.xml,/WEB-INF/wangzhaogl-service.xml,/WEB-INF/wangzhaogl-servlet.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<servlet>
<servlet-name>wangzhaogl</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>wangzhaogl</servlet-name>
<url-pattern>*.htm</url-pattern>
</servlet-mapping>
------------------------------------------------------------------------------------------------------------------
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/wangzhaogl-application.xml,/WEB-INF/wangzhao-persistence.xml,/WEB-INF/wangzhao-service.xml,/WEB-INF/wangzhao-servlet.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<servlet>
<servlet-name>wangzhao</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>wangzhao</servlet-name>
<url-pattern>*.htm</url-pattern>
</servlet-mapping>
servlet的名字要和xml文件名字的-前面的部分一致。
2.
spring 2.5 与 hibernate3.2 有asm包的冲突
把lib目录下的asm-2.2.3.jar删除就OK了
(建项目时应尽量选择将jar包都复制到lib目录下,这样可以方便删除)
报错信息:
java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V
3.
用到hibernte,项目一开始建立时,应用反向工程建pojo类和xml文件,要所有都建!并加入到配置文件中去。因为表之间是关联的,所以要一开始把所有pojo建好,以免报错!