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

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

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

HttpSession.putValue介绍

暂无

代码示例

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

public void putValue(String key, Object value) {
  session.putValue(key, value);
}

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

public void putValue(String key, Object value) {
  session.putValue(key, value);
}

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

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

代码示例来源: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: com.liferay.portal/com.liferay.portal.kernel

/**
 * @deprecated As of Bunyan (6.0.x)
 */
@Deprecated
@Override
public void putValue(String name, Object value) {
  _session.putValue(name, value);
}

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

/**
 * @deprecated
 */
public void putValue(String name, Object value) {
  _session.putValue(name, value);
}

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

/**
 * @param arg0 
 * @param arg1 
 * @see javax.servlet.http.HttpSession
 */
@SuppressWarnings("deprecation")
public void putValue(String arg0, Object arg1) {
 this.httpSession.putValue(arg0, arg1);
}

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

@Override
public void putValue(String s, Object o) {
  session.putValue(s, o);
}

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

@Override
public void putValue(final String s, final Object o) {
  session.putValue(s, o);
}

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

@Deprecated
@Override
public void putValue(String name, Object value)
{
 wrapped.putValue(name, value);
}

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

@Override
@Deprecated
public void putValue(String name, Object value) {
  session.putValue(name, value);
}

代码示例来源: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: org.jboss.weld.servlet/weld-servlet-shaded

@Override
public void putValue(String name, Object value) {
  session().putValue(name, value);
}

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

@Override
public void putValue(String name, Object value) {
  session().putValue(name, value);
}

代码示例来源:origin: org.wso2.carbon/org.wso2.carbon.bridge

/**
 * Overriden
 *
 * @param s key
 * @param o value
 */
public void putValue(String s, Object o) {
  delegate.putValue(s, new CarbonAttributeWrapper(o));
}

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

@Override
public void putValue(String name, Object value) {
  session().putValue(name, value);
}

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

@Override
public void putValue(String name, Object value) {
  session().putValue(name, value);
}

代码示例来源: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 void putValue(String name, Object value) {
  //we intercept this implementation to ensure that the session stores an efficient (small) storage representation
  //of the resource.  This ensures that the session can be serialized and de-serialized with Resource references
  //even though Resource instances are not serializable themselves.  Especially necessary if sessions are
  //clustered.
  if (value instanceof Resource) {
    Resource resource = (Resource) value;
    Class ifaceClass = DefaultResourceFactory.getInterfaceClass(resource.getClass());
    value = new ResourceReference(ifaceClass.getName(), resource.getHref());
  }
  session.putValue(name, value);
}

代码示例来源:origin: com.stormpath.sdk/stormpath-sdk-servlet

@Override
public void putValue(String name, Object value) {
  //we intercept this implementation to ensure that the session stores an efficient (small) storage representation
  //of the resource.  This ensures that the session can be serialized and de-serialized with Resource references
  //even though Resource instances are not serializable themselves.  Especially necessary if sessions are
  //clustered.
  if (value instanceof Resource) {
    Resource resource = (Resource) value;
    Class ifaceClass = DefaultResourceFactory.getInterfaceClass(resource.getClass());
    value = new ResourceReference(ifaceClass.getName(), resource.getHref());
  }
  session.putValue(name, value);
}

相关文章