摘要: 实现思路 1. 有一个登陆页面,需要写一个controller访问页面。 2. 登陆页面有一提交表单的动作。需要在controller中处理。判断用户名密码是否正确。如果正确, 向session中写入用户信息。返回登陆成功。 3. 拦截用户请求,判断用户是否登陆。如果用户已经登陆。放行, 如果用户未 阅读全文
posted @ 2022-02-25 23:55 临易 阅读(148) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>JSONP百度搜索</title> <style> #q{ width: 500px; h 阅读全文
posted @ 2022-02-25 23:43 临易 阅读(96) 评论(0) 推荐(0) 编辑
摘要: 我们写一个Controller @RequestMapping("/a3") public String ajax3(String name,String pwd){ String msg = ""; //模拟数据库中存在数据 if (name!=null){ if ("admin".equals( 阅读全文
posted @ 2022-02-25 23:42 临易 阅读(23) 评论(0) 推荐(0) 编辑
摘要: Controller 和 视图层编写 1. BookController 类编写 , 方法一:查询全部书籍 @Controller @RequestMapping("/book") public class BookController { @Autowired @Qualifier("BookSe 阅读全文
posted @ 2022-02-25 23:07 临易 阅读(69) 评论(0) 推荐(0) 编辑
摘要: 1. 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/XMLSchema-inst 阅读全文
posted @ 2022-02-25 22:56 临易 阅读(20) 评论(0) 推荐(0) 编辑
摘要: 1. 配置Spring整合MyBatis,我们这里数据源使用c3p0连接池; 2. 我们去编写Spring整合Mybatis的相关的配置文件; spring-dao.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www 阅读全文
posted @ 2022-02-25 22:19 临易 阅读(29) 评论(0) 推荐(0) 编辑