list页面都打不开了

来源:4-5 实现信息批量删除

qq_赵成冬_0

2016-08-22 08:16

不知道为什么,我照着这个代码抄了一遍,结果list页面都打不开了,配置文件我已经校验好几遍了,没有错啊!!

Message.xml:

<?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">


<mapper namespace="Message">

  <resultMap type="com.imooc.bean.Message" id="MessageResult">

    <id column="id" jdbcType="INTEGER" property="id"/>

    <result column="COMMAND" jdbcType="VARCHAR" property="command"/>

    <result column="CONTENT" jdbcType="VARCHAR" property="content"/>

    <result column="DESCRIPTION" jdbcType="VARCHAR" property="description"/>

  </resultMap>

  <select id="queryMessageList" parameterType="com.imooc.bean.Message"  resultMap="MessageResult">

   select ID,COMMAND,DESCRIPTION,CONTENT from message where 1=1 

   <if test="command!=null and!&quot;&quot;.equals(command.trim())">and COMMAND=#{command}</if>

    <if test="description!=null and!&quot;&quot;.equals(description.trim())">

    and DESCRIPTION like '%' #{description} '%'

    </if>  

  </select>

  <delete id="deleteOne" parameterType="int">

     delete from MESSAGE where ID= #{_parameter}

  </delete>

  <delete id="deleteBatch" parameterType="java.util.List">

     delete from MESSAGE where ID in(

     <foreach collection="list" item="item" separator=",">

     #{item}

     </foreach>

     )

  </delete>

</mapper>


web.xml

<?xml version="1.0" encoding="UTF-8"?>

<web-app version="2.5" 

xmlns="http://java.sun.com/xml/ns/javaee" 

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 

xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 

http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

  <display-name></display-name>

  <welcome-file-list>

    <welcome-file>index.jsp</welcome-file>

  </welcome-file-list>

<servlet>

  <servlet-name>ListServlet</servlet-name>

  <servlet-class>com.imooc.servlet.ListServlet</servlet-class>

  </servlet>

  <servlet-mapping>

  <servlet-name>ListServlet</servlet-name>

  <url-pattern>/List.action</url-pattern>

  </servlet-mapping>

  

 <servlet>

  <servlet-name>DeleteOneServlet</servlet-name>

  <servlet-class>com.imooc.servlet.DeleteOneServlet</servlet-class>

  </servlet>

  <servlet-mapping>

  <servlet-name>DeleteOneServlet</servlet-name>

  <url-pattern>/DeleteOneServlet.action</url-pattern>

  </servlet-mapping>

  

   <servlet>

  <servlet-name>DeleteBatchServlet</servlet-name>

  <servlet-class>com.imooc.servlet.DeleteBatchServlet</servlet-class>

  </servlet>

  <servlet-mapping>

  <servlet-name>DeleteBatchServlet</servlet-name>

  <url-pattern>/DeleteBatchServlet.action</url-pattern>

  </servlet-mapping>

</web-app>

  



写回答 关注

1回答

  • qq_赵成冬_0
    2016-08-22 08:50:39

    控制台没有报错,页面上报的404

    qq_赵成冬...

    解决了已经,是xml文件出了问题,我也不知道出在哪里,总之又写了一遍解决了

    2016-08-22 14:52:38

    共 1 条回复 >

通过自动回复机器人学Mybatis---基础版

微信公众号自动回复功能学习Mybatis,基础教程加案例实战方式学习

107412 学习 · 786 问题

查看课程

相似问题