javax.servlet.http.HttpServletRequestWrapper.getSession()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(4.9k)|赞(0)|评价(0)|浏览(195)

本文整理了Java中javax.servlet.http.HttpServletRequestWrapper.getSession()方法的一些代码示例,展示了HttpServletRequestWrapper.getSession()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HttpServletRequestWrapper.getSession()方法的具体详情如下:
包路径:javax.servlet.http.HttpServletRequestWrapper
类名称:HttpServletRequestWrapper
方法名:getSession

HttpServletRequestWrapper.getSession介绍

[英]The default behavior of this method is to return getSession() on the wrapped request object.
[中]此方法的默认行为是在包装的请求对象上返回getSession()。

代码示例

代码示例来源:origin: cloudfoundry/uaa

  1. @Override
  2. public HttpSession getSession(boolean create) {
  3. return super.getSession(create);
  4. }

代码示例来源:origin: cloudfoundry/uaa

  1. @Override
  2. public HttpSession getSession() {
  3. return super.getSession();
  4. }

代码示例来源:origin: geoserver/geoserver

  1. @Override
  2. public HttpSession getSession(boolean create) {
  3. HttpSession session = super.getSession(false);
  4. session = super.getSession(true);
  5. return session;

代码示例来源:origin: apache/shiro

  1. public HttpSession getSession(boolean create) {
  2. HttpSession httpSession;
  3. if (isHttpSessions()) {
  4. httpSession = super.getSession(false);
  5. if (httpSession == null && create) {
  6. //Shiro 1.2: assert that creation is enabled (SHIRO-266):
  7. if (WebUtils._isSessionCreationEnabled(this)) {
  8. httpSession = super.getSession(create);
  9. } else {
  10. throw newNoSessionCreationException();
  11. }
  12. }
  13. } else {
  14. boolean existing = getSubject().getSession(false) != null;
  15. if (this.session == null || !existing) {
  16. Session shiroSession = getSubject().getSession(create);
  17. if (shiroSession != null) {
  18. this.session = new ShiroHttpSession(shiroSession, this, this.servletContext);
  19. if (!existing) {
  20. setAttribute(REFERENCED_SESSION_IS_NEW, Boolean.TRUE);
  21. }
  22. } else if (this.session != null) {
  23. this.session = null;
  24. }
  25. }
  26. httpSession = this.session;
  27. }
  28. return httpSession;
  29. }

代码示例来源:origin: webx/citrus

  1. @Override
  2. public HttpSession getSession(boolean create) {
  3. if (create) {
  4. sessionCreated = true;
  5. }
  6. return super.getSession(create);
  7. }
  8. }

代码示例来源:origin: webx/citrus

  1. @Override
  2. public HttpSession getSession() {
  3. sessionCreated = true;
  4. return super.getSession();
  5. }

代码示例来源:origin: webx/citrus

  1. @Override
  2. public HttpSession getSession(boolean create) {
  3. if (create) {
  4. sessionCreated = true;
  5. }
  6. return super.getSession(create);
  7. }
  8. }

代码示例来源:origin: webx/citrus

  1. @Override
  2. public HttpSession getSession() {
  3. sessionCreated = true;
  4. return super.getSession();
  5. }

代码示例来源:origin: apache/geode

  1. HttpSession nativeSession = super.getSession();
  2. try {
  3. session = (GemfireHttpSession) manager.wrapSession(context,

代码示例来源:origin: paoding-code/paoding-rose

  1. @Override
  2. public HttpSession getSession(boolean create) {
  3. HttpSession session = super.getSession(false);
  4. if (session != null) {
  5. return session;
  6. }
  7. if (create) {
  8. if (window.getContainer().getInvocation().getResponse().isCommitted()) {
  9. session = new SessionAfterCommitted(new IllegalStateException(
  10. "Cannot create a session after the response has been committed"));
  11. } else {
  12. try {
  13. session = super.getSession(true);
  14. } catch (IllegalStateException e) {
  15. session = new SessionAfterCommitted(e);
  16. }
  17. }
  18. }
  19. return session;
  20. }

代码示例来源:origin: com.atlassian.jira/jira-core

  1. @Override
  2. public HttpSession getSession(final boolean create)
  3. {
  4. HttpSession session = super.getSession(create);
  5. return session;
  6. }

代码示例来源:origin: com.atlassian.jira/jira-core

  1. @Override
  2. public HttpSession getSession()
  3. {
  4. HttpSession session = super.getSession();
  5. return session;
  6. }

代码示例来源:origin: com.github.wuic/wuic-servlet

  1. /**
  2. * {@inheritDoc}
  3. */
  4. @Override
  5. public HttpSession getSession(final boolean create) {
  6. // Synchronized access
  7. synchronized (mutex) {
  8. return super.getSession(create);
  9. }
  10. }

代码示例来源:origin: org.apache.portals.pluto/pluto-container

  1. @Override
  2. public HttpSession getSession(boolean create) {
  3. if (isClosed) return null;
  4. return session != null ? session : super.getSession(create);
  5. }

代码示例来源:origin: org.apache.portals.pluto/pluto-container

  1. @Override
  2. public HttpSession getSession() {
  3. if (isClosed) return null;
  4. return session != null ? session : super.getSession();
  5. }

代码示例来源:origin: org.apache.axis2/axis2-transport-http

  1. @Override
  2. public HttpSession getSession(boolean create) {
  3. HttpSession session = super.getSession(false);
  4. if (create && session == null) {
  5. throw new IllegalStateException("Session creation forbidden");
  6. } else {
  7. return session;
  8. }
  9. }
  10. }

代码示例来源:origin: com.cloudbees/vietnam4j-core

  1. @Override
  2. public HttpSession getSession(boolean create) {
  3. HttpSession base = super.getSession(create);
  4. if (base==null) return null;
  5. return webApp.getProxiedSession(base);
  6. }
  7. }

代码示例来源:origin: Jasig/uPortal

  1. @Override
  2. public HttpSession getSession() {
  3. this.checkState();
  4. return super.getSession();
  5. }

代码示例来源:origin: stormpath/stormpath-sdk-java

  1. @Override
  2. public HttpSession getSession(boolean create) {
  3. //need to wrap the session so get/setAttribute and get/putValue implementations handle Resources efficiently:
  4. HttpSession session = super.getSession(create);
  5. if (session != null) {
  6. session = new StormpathHttpSession(session);
  7. }
  8. return session;
  9. }

代码示例来源:origin: com.hazelcast/hazelcast-all

  1. HttpSession getOriginalSession(boolean create) {
  2. // Find the top non-wrapped Http Servlet request
  3. HttpServletRequest req = (HttpServletRequest) getRequest();
  4. while (req instanceof HttpServletRequestWrapper) {
  5. req = (HttpServletRequest) ((HttpServletRequestWrapper) req).getRequest();
  6. }
  7. if (req != null) {
  8. return req.getSession(create);
  9. } else {
  10. return super.getSession(create);
  11. }
  12. }

相关文章

HttpServletRequestWrapper类方法