org.nutz.mvc.impl.session.NopSessionProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nutz Show documentation
Show all versions of nutz Show documentation
Nutz, which is a collections of lightweight frameworks, each of them can be used independently
package org.nutz.mvc.impl.session;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
/**
* 使用容器原生的Session实现 == 等于什么都没做.
*
*/
public class NopSessionProvider extends AbstractSessionProvider {
public HttpSession createSession(HttpServletRequest req,
HttpServletResponse resp,
ServletContext servletContext) {
//使用容器原生的Session实现 == 等于什么都没做
return req.getSession(true);
}
public HttpSession getExistSession(HttpServletRequest req, HttpServletResponse resp, ServletContext servletContext) {
return req.getSession(false);
}
}