DEBUG [http-8080-10] - DispatcherServlet with name 'springMvc' processing GET request for [/XYKJOA/getALLWorkPlan.do]
DEBUG [http-8080-10] - Looking up handler method for path /getALLWorkPlan.do
DEBUG [http-8080-10] - Returning handler method [public java.lang.String com.xykj.controller.WorkPlanController.getALLWorkPlan(javax.servlet.http.HttpServletRequest)]
DEBUG [http-8080-10] - Returning cached instance of singleton bean 'workPlanController'
DEBUG [http-8080-10] - Last-Modified value for [/XYKJOA/getALLWorkPlan.do] is: -1
DEBUG [http-8080-10] - Creating a new SqlSession
DEBUG [http-8080-10] - Registering transaction synchronization for SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@707cdc58]
DEBUG [http-8080-10] - Fetching JDBC Connection from DataSource
DEBUG [http-8080-10] - Registering transaction synchronization for JDBC Connection
DEBUG [http-8080-10] - JDBC Connection [com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl@24d2fb67] will be managed by Spring
DEBUG [http-8080-10] - ooo Using Connection [com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl@24d2fb67]
DEBUG [http-8080-10] - ==> Preparing: select * from XY_WorkPlan
DEBUG [http-8080-10] - ==> Parameters:
DEBUG [http-8080-10] - Releasing transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@707cdc58]
DEBUG [http-8080-10] - Should roll back transaction but cannot - no transaction available
DEBUG [http-8080-10] - Transaction synchronization closing SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@707cdc58]
DEBUG [http-8080-10] - Returning JDBC Connection to DataSource
DEBUG [http-8080-10] - Rendering view [org.springframework.web.servlet.view.JstlView: name 'work/workplan_list'; URL [/work/workplan_list.jsp]] in DispatcherServlet with name 'springMvc'
DEBUG [http-8080-10] - Forwarding to resource [/work/workplan_list.jsp] in InternalResourceView 'work/workplan_list'
DEBUG [http-8080-10] - Successfully completed request
spring-mvc.xml
<?xml version="1.0" encoding="UTF-8"?>
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
mvc:annotation-driven/
<!-- 自动扫描controller包下的所有类,使其认为spring mvc的控制器 -->
/context:component-scan
<bean id="paramMethodResolver" class="org.springframework.web.servlet.mvc.multiaction.ParameterMethodNameResolver">
<property name="paramName" value="action" />
</bean>
<!-- 对模型视图名称的解析,即在模型视图名称添加前后缀 -->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"
p:prefix="/" p:suffix=".jsp" />
<mvc:annotation-driven></mvc:annotation-driven>
<!-- 上传配置multipart -->
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<!-- 设置文件大小5M -->
<property name="maxUploadSize" value="5000000"></property>
</bean>
<!-- <mvc:resources location="work/images" mapping="images/**"/>
<mvc:resources location="work/js" mapping="js/**"/>
<mvc:resources location="work/css" mapping="css/**"/> -->
spring.xml
<context:property-placeholder location="classpath:config.properties" />
<!-- 自动扫描(自动注入) -->
<context:component-scan base-package="com.xykj.service..*" />
映射文件
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
</resultMap>
<resultMap type="com.xykj.model.XY_WorkPlanType" id="WorkPlanTypeMap">
<id column="WPT_ID" property="WPT_ID" />
<result column="WPT_TypeName" property="wPT_TypeName" />
<result column="WPT_Desc" property="WPT_Desc" />
</resultMap>
<!--工作计划类型begin -->
<select id="getWorkPlanType" resultMap="WorkPlanTypeMap">
SELECT * FROM
XY_WorkPlanType
</select>
<insert id="addWorkPlanType" parameterType="com.xykj.model.XY_WorkPlanType">
INSERT INTO
XY_WorkPlanType
VALUES(#{WPT_TypeName},#{WPT_Desc})
</insert>
<delete id="delWorkPlanType" parameterType="com.xykj.model.XY_WorkPlanType">
DELETE
XY_WorkPlanType WEHRE WPT_ID=#{ID}
</delete>
<!--工作计划类型end -->
<select id="getALLWorkPlan" resultMap="WorkPlanMap">
select a.WP_ID,a.WP_Name,a.WP_State,a.WP_JD,b.WPT_TypeName from XY_WorkPlan
as a
inner join XY_WorkPlanType as b
on
a.WPT_ID=b.WPT_ID
</select>
<insert id="addWorkPlan" parameterType="com.xykj.model.XY_WorkPlan">
INSERT INTO XY_WorkPlan
VALUES
(#{WP_Name},#{WP_Cont},#{WP_BeginTime},#{WP_EndTime},#{WP_JD},#{work.WPT_ID},#{WP_FuZe},#{WP_CanYu},#{WP_State},#{WP_Desc})
</insert>
<select id="getWorkPlanByID" resultMap="WorkPlanMap"
parameterType="java.lang.Integer">
SELECT
a.WP_JD,a.WP_Cont,a.WP_BeginTime,a.WP_EndTime,b.WPT_TypeName,a.WP_CanYu,a.WP_FuZe,a.WP_State,a.WP_Desc
FROM
XY_WorkPlan as a inner join XY_WorkPlanType as b
ON
a.WPT_ID=b.WPT_ID
WHERE
a.WPT_ID=#{id}
</select>
贴控制器的代码、。。。。。。。
具体看一下,控制器里的代码,怎么执行的
请问你spring和mybatis整合的xml文件是怎么写的?Dao是接口扫描mapping还是自己实现的?