CookieValue注解
生活随笔
收集整理的這篇文章主要介紹了
CookieValue注解
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head><title>Title</title>
</head>
<body><%--常用的注解--%><a href="anno/testCookieValue">CookieValue</a></body>
</html>
package com.learn.controller;import com.learn.domain.User;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.support.SessionStatus;import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Date;
import java.util.Map;/*** 常用的注解*/
@Controller
@RequestMapping("/anno")
public class AnnoController {/*** 獲取Cookie的值* @return*/@RequestMapping(value="/testCookieValue")public String testCookieValue(@CookieValue(value="JSESSIONID") String cookieValue){System.out.println("執(zhí)行了...");System.out.println(cookieValue);return "success";}}
?
超強干貨來襲 云風(fēng)專訪:近40年碼齡,通宵達旦的技術(shù)人生總結(jié)
以上是生活随笔為你收集整理的CookieValue注解的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: RequestBody注解
- 下一篇: ModelAttribute注解