摘要:
1.ModelAndView, RESTful request,@PathVariable 1 @RequestMapping("/user/get/{uid}") 2 public ModelAndView getUserById(@PathVariable("uid") Integer uid) 阅读全文
posted @ 2023-06-14 07:02
ming1010
阅读(22)
评论(0)
推荐(0)
摘要:
步骤 1.form表单请求登录 2.验证登录成功,进入登录成功页面 3.权限拦截:当直接通过登录成功的URL访问时(跳过用户登录验证),不能直接访问。 核心代码部分: LoginServlet用户名验证: 1 protected void doGet(HttpServletRequest req, 阅读全文
posted @ 2023-06-14 07:02
ming1010
阅读(130)
评论(0)
推荐(0)
摘要:
1.实现Filter接口,主要重写doFilter方法 1 public class CharacterEncodingFilter implements Filter { 2 @Override 3 public void init(FilterConfig filterConfig) throw 阅读全文
posted @ 2023-06-14 07:01
ming1010
阅读(17)
评论(0)
推荐(0)
摘要:
@RequestMapping 1.RequestMapping path,请求映射的路径 1 @Controller 2 public class HelloController { 3 @RequestMapping("/hello") 4 public String sayHello(){ 5 阅读全文
posted @ 2023-06-14 07:01
ming1010
阅读(15)
评论(0)
推荐(0)
摘要:
1.springmvc web.xml 1.1配置版springmvc(configuration)_web.xml 1 <?xml version="1.0" encoding="UTF-8"?> 2 <web-app xmlns="https://jakarta.ee/xml/ns/jakart 阅读全文
posted @ 2023-06-14 07:00
ming1010
阅读(21)
评论(0)
推荐(0)
摘要:
jsp @include Directive jsp:include Action 1 <html> 2 <head> 3 <title>Title</title> 4 </head> 5 <body> 6 <%--两个页面合二为一,包含在同一块代码里--%> 7 <%@include file=" 阅读全文
posted @ 2023-06-14 07:00
ming1010
阅读(11)
评论(0)
推荐(0)
摘要:
error page in .jsp 1 <%@ page contentType="text/html;charset=UTF-8" language="java" %> 2 <%--<%@ page errorPage="error/500.jsp" %>--%> 3 <%--<%@ page 阅读全文
posted @ 2023-06-14 06:59
ming1010
阅读(17)
评论(0)
推荐(0)
摘要:
JSP-java server pages 1. jsp scriptlet 1 <%--jsp scriptlet--%> 2 <% 3 int sum = 0; 4 for (int i = 1; i <= 100; i++) { 5 sum += i; 6 } 7 out.println("< 阅读全文
posted @ 2023-06-14 06:59
ming1010
阅读(8)
评论(0)
推荐(0)
摘要:
Session-Server side(store info in server, server created the session) server(tomcat) will create a session to each client(browser), one session with o 阅读全文
posted @ 2023-06-14 06:59
ming1010
阅读(5)
评论(0)
推荐(0)
摘要:
Cookie -Client side (request, response) 1 Cookie[] cookies = req.getCookies();// gets cookies 2 //whether there is a cookie 3 if(cookies!=null){ 4 out 阅读全文
posted @ 2023-06-14 06:59
ming1010
阅读(8)
评论(0)
推荐(0)