de.nidanet.dev.google.persistent_users
Class PersistentUsersServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by de.nidanet.dev.google.persistent_users.PersistentUsersServlet
All Implemented Interfaces:
Serializable, Servlet, ServletConfig

public class PersistentUsersServlet
extends HttpServlet

This is a tiny servlet to test the persistence data handling in Google's Appengine.

Since:
2009-06-16
Version:
1.0
Author:
Nico Danneberg (mail@danneberg.de)
See Also:
Serialized Form

Field Summary
private  PrintWriter out
          The output stream of the response.
private  javax.jdo.PersistenceManager pm
          The Persistence Manager.
 
Constructor Summary
PersistentUsersServlet()
           
 
Method Summary
private  void createForm()
          Prints the form to create a user to the response channel.
 void doGet(HttpServletRequest req, HttpServletResponse resp)
          This method is called for every (get-)request.
 void init()
          The initialization message is called at startup of this servlet.
private  void out(String msg)
          Forwards the incoming message to one of the print methods of the response channel.
private  void showUsersList()
          Prints a list of all currently stored users to the response channel.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

out

private PrintWriter out
The output stream of the response.


pm

private javax.jdo.PersistenceManager pm
The Persistence Manager.

Constructor Detail

PersistentUsersServlet

public PersistentUsersServlet()
Method Detail

init

public void init()
The initialization message is called at startup of this servlet. It only gets a new Persistence Manager.

Overrides:
init in class GenericServlet

doGet

public void doGet(HttpServletRequest req,
                  HttpServletResponse resp)
           throws IOException
This method is called for every (get-)request. It prints out a standard headline and checks the "action" parameter what to do.

Overrides:
doGet in class HttpServlet
Parameters:
req - the request
resp - the response
Throws:
IOException

showUsersList

private void showUsersList()
Prints a list of all currently stored users to the response channel.


createForm

private void createForm()
Prints the form to create a user to the response channel.


out

private void out(String msg)
Forwards the incoming message to one of the print methods of the response channel.

Parameters:
msg - the text to print out
See Also:
PrintWriter.println( String );