Fork me on GitHub
摘要: @WebServlet(urlPatterns = {"/text"}) //服务器端声明,用户接收前端发送的请求 前端: var xhr = new XMLHttpRequest(); //创建AJAX对象 xhr.open("get","/text",true); // 设置发送参数 xhr.s 阅读全文
posted @ 2024-03-25 21:11 一名狗书匠& 阅读(1) 评论(0) 推荐(0) 编辑
摘要: web.xml 配置文件 最新依赖 <?xml version="1.0" encoding="UTF-8"?><web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchem 阅读全文
posted @ 2024-03-25 21:10 一名狗书匠& 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 新建spring-dao.xml文件 <?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/ 阅读全文
posted @ 2024-03-25 21:09 一名狗书匠& 阅读(1) 评论(0) 推荐(0) 编辑
摘要: //第一步,在web.xml文件中注册<?xml version="1.0" encoding="UTF-8"?><web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSche 阅读全文
posted @ 2024-03-25 21:08 一名狗书匠& 阅读(1) 评论(0) 推荐(0) 编辑
摘要: beans.xml 配置文件 <!--不建议使用--> <!-- <bean id="user" class="com.jiang.pojo.user">--><!-- <constructor-arg index="0" value="岳不群"/>--><!-- </bean>--> <!-- < 阅读全文
posted @ 2024-03-16 22:41 一名狗书匠& 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 缓存:mybatis中默认开启一级缓存sqlSession.clearCache(); 清除缓存<cache/> 开启二级缓存<cache type="org.apache.ibatis.cache.impl.PerpetualCache" size="1024" eviction="LRU" fl 阅读全文
posted @ 2024-03-16 22:40 一名狗书匠& 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 动态sqlif 做判断拼接sql语句choose,when 类似于Java的switch判断set 修改语句专用,可以自动排错,比如多写了逗号sql,include 用于提取重复的语句,提高复用foreach 用于动态的查询多条信息 <!--if--> <select id="getBlogBy"> 阅读全文
posted @ 2024-03-16 22:40 一名狗书匠& 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 连表查询多对一查询 <select id="findAll2" resultMap="a1"> SELECT s.`id` sid ,s.`name` sname ,t.`name` tname FROM `student` s ,`teacher` t WHERE s.`tid`=t.`id`</ 阅读全文
posted @ 2024-03-16 22:40 一名狗书匠& 阅读(2) 评论(0) 推荐(0) 编辑
摘要: //新建一个mybatis-config.xml文件<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "https://mybatis. 阅读全文
posted @ 2024-03-07 20:56 一名狗书匠& 阅读(1) 评论(0) 推荐(0) 编辑
摘要: web.xml 配置文件 最新依赖 <?xml version="1.0" encoding="UTF-8"?><web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchem 阅读全文
posted @ 2024-03-07 20:55 一名狗书匠& 阅读(18) 评论(0) 推荐(0) 编辑

asd