I am getting started with using the GAE server side session
management. From what I read in the documentation I should see a table
(_ah_Sessions) created in the datastore when I call
session.setAttribute(). However the table is not created. Simple
session functionality works as I demonstrate with the simple test code
below.
BTW, I am currently only working in the DEV environment have not
launched yet.
Here is my code:
Sessions enabled:
<sessions-enabled>true</sessions-enabled>
___MySessionTestServlet.java ___
public class MySessionTestServlet extends
javax.servlet.http.HttpServlet{
public void doGet (HttpServletRequest req, HttpServletResponse resp)
throws IOException{
HttpSession session = req.getSession(true);
session.setAttribute("test_this", "123");
resp.sendRedirect("sessiontest.jsp");
}
}
__sessiontest.jsp__
<%@ page import="mypackage.MySessionTestServlet"%>
<%@ page import="java.util.Enumeration"%>
<html>
<body>
<%
Enumeration en = session.getAttributeNames();
%>
<a href="/sessiondebug">Debug session</a>
<table border="1">
<tr>
<td>Parameter</td><td>Value</td>
</tr>
<tr>
<td>Session Id</td><td><%=session.getId()%></td>
</tr>
<% while (en.hasMoreElements()) {
String AttrName = (String) en.nextElement();
%>
<tr>
<td><%= AttrName %></td><td><%=
session.getAttribute(AttrName)%></
td>
</tr>
<%}%>
</table>
</body>
</html>
--
You received this message because you are subscribed to the Google Groups
"Google App Engine for Java" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine-java?hl=en.