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

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

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

HttpSession.getValue介绍

暂无

代码示例

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

public Object getValue(String key) {
  return session.getValue(key);
}

代码示例来源:origin: spring-projects/spring-session

@Override
  public void doFilter(HttpServletRequest wrappedRequest) {
    assertThat(wrappedRequest.getSession().getValue(ATTR)).isEqualTo(VALUE);
    assertThat(Arrays.asList(wrappedRequest.getSession().getValueNames()))
        .containsOnly(ATTR);
  }
});

代码示例来源:origin: spring-projects/spring-session

@Override
  public void doFilter(HttpServletRequest wrappedRequest) {
    wrappedRequest.getSession().putValue(ATTR, VALUE);
    assertThat(wrappedRequest.getSession().getValue(ATTR)).isEqualTo(VALUE);
    assertThat(Arrays.asList(wrappedRequest.getSession().getValueNames()))
        .containsOnly(ATTR);
  }
});

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

public Object getValue(String key) {
  return session.getValue(key);
}

代码示例来源:origin: spring-projects/spring-session

@Override
  public void doFilter(HttpServletRequest wrappedRequest) {
    assertThat(wrappedRequest.getSession().getValue(ATTR)).isEqualTo(VALUE);
    wrappedRequest.getSession().removeValue(ATTR);
    assertThat(wrappedRequest.getSession().getValue(ATTR)).isNull();
  }
});

代码示例来源:origin: spring-projects/spring-session

@Override
  public void doFilter(HttpServletRequest wrappedRequest) {
    HttpSession session = wrappedRequest.getSession();
    session.invalidate();
    try {
      session.getValue("attr");
      fail("Expected Exception");
    }
    catch (IllegalStateException ignored) {
    }
  }
});

代码示例来源:origin: spring-projects/spring-session

@Override
  public void doFilter(HttpServletRequest wrappedRequest) {
    assertThat(wrappedRequest.getSession().getValue(ATTR)).isNull();
  }
});

代码示例来源:origin: com.liferay.portal/com.liferay.portal.kernel

/**
 * @deprecated As of Bunyan (6.0.x)
 */
@Deprecated
@Override
public Object getValue(String name) {
  return _session.getValue(name);
}

代码示例来源:origin: com.liferay.portal/portal-kernel

/**
 * @deprecated
 */
public Object getValue(String name) {
  return _session.getValue(name);
}

代码示例来源:origin: org.apache.tomee/openejb-http

@Override
public Object getValue(String s) {
  return session.getValue(s);
}

代码示例来源:origin: edu.internet2.middleware.grouper/grouper-ui

/**
 * @param arg0 
 * @return the value
 * @see javax.servlet.http.HttpSession
 */
@SuppressWarnings("deprecation")
public Object getValue(String arg0) {
 return this.httpSession.getValue(arg0);
}

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

@Override
public Object getValue(final String s) {
  return session.getValue(s);
}

代码示例来源:origin: com.qwazr/qwazr-webapps

@Override
@Deprecated
public Object getValue(String name) {
  return session.getValue(name);
}

代码示例来源:origin: org.jboss.jsfunit/jboss-jsfunit-core

@Deprecated
@Override
public Object getValue(String name)
{
 return wrapped.getValue(name);
}

代码示例来源:origin: weld/core

@Override
public Object getValue(String name) {
  return session().getValue(name);
}

代码示例来源:origin: org.jboss.weld.servlet/weld-servlet-shaded

@Override
public Object getValue(String name) {
  return session().getValue(name);
}

代码示例来源:origin: stackoverflow.com

HttpSession session = request.getSession(true);
Integer ival = (Integer) session.getValue("knownuser");
if (ival==null) {
  ival = new Integer(1);
  incrementUsersCounter ();
  session.putValue("knownuser", ival);
}

代码示例来源:origin: weld/core

@Override
public Object getValue(String name) {
  return session().getValue(name);
}

代码示例来源:origin: stackoverflow.com

HttpSession session = request.getSession(true);
shoppingcart shop = (shoppingcart)session.getValue("shop");
if(shop == null) {
  shop = new shoppingcart();
  session.putValue("shop", shop);
}

shop.ins(p);

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

@Override
public Object getValue(String name) {
  //this logic complements the putValue implementation:
  Object o = session.getValue(name);
  if (o instanceof ResourceReference) {
    ResourceReference ref = (ResourceReference) o;
    String href = ref.getHref();
    Class clazz = Classes.forName(ref.getResourceClassName());
    Client client = getClient();
    o = client.getResource(href, clazz);
  }
  return o;
}

相关文章