Add object as session attribute for SessionDump test servlet

This commit is contained in:
Jan Bartel 2015-07-28 15:49:31 +10:00
parent dea406d2b3
commit 2e4941920b
1 changed files with 18 additions and 0 deletions

View File

@ -36,6 +36,23 @@ import javax.servlet.http.HttpSession;
@SuppressWarnings("serial")
public class SessionDump extends HttpServlet
{
/**
* Simple object attribute to test serialization
*/
public class ObjectAttributeValue implements java.io.Serializable
{
long l;
public ObjectAttributeValue(long l)
{
this.l = l;
}
public long getValue()
{
return l;
}
}
int redirectCount=0;
/* ------------------------------------------------------------ */
@ -64,6 +81,7 @@ public class SessionDump extends HttpServlet
{
session = request.getSession(true);
session.setAttribute("test","value");
session.setAttribute("obj", new ObjectAttributeValue(System.currentTimeMillis()));
}
else if (session!=null)
{