|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.servlet.GenericServlet
javax.servlet.http.HttpServlet
com.ibm.websphere.samples.activitysessionWAR.MasterMind
public class MasterMind
The MasterMind Servlet.
At the start of a game the Servlet creates a new HttPSession and
stores a reference to an instance of the MasterMindGame Entity EJB.
The servlet solicits guesses from the user and displays the results.
Once the game is over, either because the guess is corrrect,
too many guesses have been attempted, or a new game has been requested,
the session is invalidated and the EJB removed.
Since the Servlet is deployed with an activity session control of
webcontainer, an ActivitySession is associated with the HttpSession.
This ties in with the activation policy of the EJB, which is ActivitySession,
and hence the EJB remains in active state for the duration of the HttpSession,
or until it is deleted.
Constructor Summary | |
---|---|
MasterMind()
|
Method Summary | |
---|---|
void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Process incoming HTTP GET requests by passing them to performTask |
void |
doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Process incoming HTTP POST requests by passing them to performTask |
java.lang.String |
getServletInfo()
Returns the servlet info string. |
void |
init()
Initializes the servlet. |
void |
performTask(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Process incoming requests for information The method examines the action in the form and either processes a new game, a guess, or a request for Instructions. |
Methods inherited from class javax.servlet.http.HttpServlet |
---|
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service |
Methods inherited from class javax.servlet.GenericServlet |
---|
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, log, log |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MasterMind()
Method Detail |
---|
public void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException
doGet
in class javax.servlet.http.HttpServlet
request
- Object that encapsulates the request to the servletresponse
- Object that encapsulates the response from the servlet
javax.servlet.ServletException
java.io.IOException
public void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException
doPost
in class javax.servlet.http.HttpServlet
request
- Object that encapsulates the request to the servletresponse
- Object that encapsulates the response from the servlet
javax.servlet.ServletException
java.io.IOException
public java.lang.String getServletInfo()
getServletInfo
in interface javax.servlet.Servlet
getServletInfo
in class javax.servlet.GenericServlet
public void init()
init
in class javax.servlet.GenericServlet
public void performTask(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
request
- Object that encapsulates the request to the servletresponse
- Object that encapsulates the response from the servlet
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |