摘要: /* Error Codes */ #define CL_SUCCESS 0 #define CL_DEVICE_NOT_FOUND -1 #define CL_DEVICE_NOT_AVAILABLE -2 #define CL_COMPILER_NOT_AVAILABLE -3 #define 阅读全文
posted @ 2022-03-17 19:32 搞点薯条 阅读(947) 评论(0) 推荐(0) 编辑
摘要: 检查引入路径 我用的这种,其中css文件夹和jsp文件同目录 <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+requ 阅读全文
posted @ 2020-03-15 21:27 搞点薯条 阅读(1127) 评论(0) 推荐(0) 编辑
摘要: 修改web.xml 将spring和springMVC配置文件一同加载 <init-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:spring-mvc.xml,classpath:applic 阅读全文
posted @ 2020-03-15 20:04 搞点薯条 阅读(230) 评论(0) 推荐(0) 编辑
摘要: 建立controller层 UserController.java package com.imust.controller; import org.springframework.stereotype.Controller; import org.springframework.web.bind. 阅读全文
posted @ 2020-03-15 19:26 搞点薯条 阅读(200) 评论(0) 推荐(0) 编辑
摘要: 整合配置文件 实质就是将mybatis的配置文件SqlSessionConfiguration.xml的配置信息整合到spring的核心配置文件applicationContext.xml中 applicationContext.xml <?xml version="1.0" encoding="U 阅读全文
posted @ 2020-03-15 17:37 搞点薯条 阅读(222) 评论(0) 推荐(0) 编辑
摘要: 建立maven的web工程 项目结构如图,如有细微区别可自行建包然后Mark Directory as spring核心配置文件applicationContext.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www 阅读全文
posted @ 2020-03-15 15:43 搞点薯条 阅读(362) 评论(0) 推荐(0) 编辑
摘要: 新建impl包,用于存放dao接口的实现类们 UserDaoImpl.java: package com.itheima.impl; import com.itheima.dao.IUserDao; import com.itheima.domain.User; import org.apache. 阅读全文
posted @ 2020-03-14 22:08 搞点薯条 阅读(280) 评论(0) 推荐(0) 编辑
摘要: 删除上一篇的IUserDao.xml映射文件 在IUserDao接口的方法上一行加上注解 @Select("select * from user") 注意自动加载本地maven仓库 在主配置文件SqlMapConfig.xml中修改 <!--指定映射配置文件的位置,映射文件指的是每个dao独立的配置 阅读全文
posted @ 2020-03-14 21:18 搞点薯条 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 在之前的mapper文件中加入 resultType="com.itheima.domain.User" 以告诉mybatis我要的返回值类型 接着编写测试类,MybatisTest.java: package com.itheima; import com.itheima.dao.IUserDao 阅读全文
posted @ 2020-03-14 20:34 搞点薯条 阅读(225) 评论(0) 推荐(0) 编辑
摘要: 创建maven工程 用不用骨架创建都可以,我这里没有用骨架,直接下一步 在pom文件中引入用到的坐标 这里注意让你的IDEA自动导入maven本地仓库 <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache 阅读全文
posted @ 2020-03-14 20:03 搞点薯条 阅读(169) 评论(0) 推荐(0) 编辑