Add object as session attribute for SessionDump test servlet
This commit is contained in:
parent
dea406d2b3
commit
2e4941920b
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue