本文整理汇总了Java中org.apache.catalina.session.StandardSessionFacade类的典型用法代码示例。如果您正苦于以下问题:Java StandardSessionFacade类的具体用法?Java StandardSessionFacade怎么用?Java StandardSessionFacade使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StandardSessionFacade类属于org.apache.catalina.session包,在下文中一共展示了StandardSessionFacade类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: serializeFrom
import org.apache.catalina.session.StandardSessionFacade; //导入依赖的package包/类
public static byte[] serializeFrom(HttpSession session) throws IOException, NoSuchFieldException, SecurityException,
IllegalArgumentException, IllegalAccessException {
if (session != null) {
Field facadeSessionField = StandardSessionFacade.class.getDeclaredField("session");
facadeSessionField.setAccessible(true);
StandardSession standardSession = (StandardSession) facadeSessionField.get(session);
if (standardSession != null) {
// StandardSessionFacade standardSession =
// (StandardSessionFacade) session;
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(new BufferedOutputStream(bos));
oos.writeLong(standardSession.getCreationTime());
standardSession.writeObjectData(oos);
oos.close();
return bos.toByteArray();
}
}
return null;
}
开发者ID:geetools,项目名称:geeCommerce-Java-Shop-Software-and-PIM,代码行数:24,代码来源:JavaSerializer.java
示例2: deserializeInto
import org.apache.catalina.session.StandardSessionFacade; //导入依赖的package包/类
public static HttpSession deserializeInto(byte[] data, HttpSession session, ClassLoader loader)
throws IOException, ClassNotFoundException, NoSuchFieldException, SecurityException,
IllegalArgumentException, IllegalAccessException {
if (data != null && data.length > 0 && session != null) {
Field facadeSessionField = StandardSessionFacade.class.getDeclaredField("session");
facadeSessionField.setAccessible(true);
StandardSession standardSession = (StandardSession) facadeSessionField.get(session);
// StandardSessionFacade standardSession = (StandardSessionFacade)
// session;
BufferedInputStream bis = new BufferedInputStream(new ByteArrayInputStream(data));
ObjectInputStream ois = new CustomObjectInputStream(bis, loader);
standardSession.setCreationTime(ois.readLong());
standardSession.readObjectData(ois);
}
return session;
}
开发者ID:geetools,项目名称:geeCommerce-Java-Shop-Software-and-PIM,代码行数:21,代码来源:JavaSerializer.java
示例3: getSession
import org.apache.catalina.session.StandardSessionFacade; //导入依赖的package包/类
public HttpSession getSession(boolean create) {
HttpSession session =
((HttpServletRequest) request).getSession(create);
if (session == null)
return null;
else
return new StandardSessionFacade(session);
}
开发者ID:c-rainstorm,项目名称:jerrydog,代码行数:9,代码来源:HttpRequestFacade.java
示例4: GlassFishAsyncServlet
import org.apache.catalina.session.StandardSessionFacade; //导入依赖的package包/类
public GlassFishAsyncServlet() throws SecurityException, NoSuchFieldException {
sessionField = StandardSessionFacade.class.getDeclaredField("session");
sessionField.setAccessible(true);
}
开发者ID:rzschech,项目名称:gwt-comet,代码行数:5,代码来源:GlassFishAsyncServlet.java
示例5: Catalina60AsyncServlet
import org.apache.catalina.session.StandardSessionFacade; //导入依赖的package包/类
public Catalina60AsyncServlet() throws SecurityException, NoSuchFieldException {
sessionField = StandardSessionFacade.class.getDeclaredField("session");
sessionField.setAccessible(true);
}
开发者ID:rzschech,项目名称:gwt-comet,代码行数:5,代码来源:Catalina60AsyncServlet.java
注:本文中的org.apache.catalina.session.StandardSessionFacade类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论