笑傲Java面试:面霸修炼手册
作者:互联网
笑傲Java面试:面霸修炼手册
V:ititit111222333
//@Controller
@ApiIgnore
@RestController
public class HelloController {
final static Logger logger = LoggerFactory.getLogger(HelloController.class);
@GetMapping("/hello")
public Object hello() {
logger.debug("debug: hello~");
logger.info("info: hello~");
logger.warn("warn: hello~");
logger.error("error: hello~");
return "Hello World~";
}
@GetMapping("/setSession")
public Object setSession(HttpServletRequest request) {
HttpSession session = request.getSession();
session.setAttribute("userInfo", "new user");
session.setMaxInactiveInterval(3600);
session.getAttribute("userInfo");
// session.removeAttribute("userInfo");
return "ok";
}
}
标签:笑傲,Java,session,userInfo,logger,面霸,hello 来源: https://blog.51cto.com/u_15063244/2702292