public class TellerHandlerServlet extends HttpServlet
Modifier and Type | Class and Description |
---|---|
private class |
TellerHandlerServlet.CloseAccount |
private class |
TellerHandlerServlet.CreateAccount |
private class |
TellerHandlerServlet.CreateAccounts |
private class |
TellerHandlerServlet.DepositAccount |
private class |
TellerHandlerServlet.GetAccount |
private class |
TellerHandlerServlet.GetAccounts |
private class |
TellerHandlerServlet.GetLedger |
private class |
TellerHandlerServlet.Handler |
private class |
TellerHandlerServlet.StealAccounts |
private class |
TellerHandlerServlet.WithdrawAccount |
Modifier and Type | Field and Description |
---|---|
static String |
ADMIN_TYPE |
static String |
CLOSE_ACCOUNT_COMMAND |
static String |
COMMAND_PARAM |
static String |
CREATE_ACCOUNT_COMMAND |
static String |
CREATE_ACCOUNTS_COMMAND |
static String |
DEPOSIT_COMMAND |
private Properties |
env |
static String |
EXCEPTION_PARAM |
static String |
GET_ACCOUNT_COMMAND |
static String |
GET_ACCOUNTS_COMMAND |
static String |
GET_LEDGER_COMMAND |
static String |
HANDLER_TYPE_KEY |
private Map<String,TellerHandlerServlet.Handler> |
handlers |
private Teller |
injectedTeller
This will get automatically injected when running within the
application server with the TellerEJB.
|
static String |
jndiName |
private static org.apache.commons.logging.Log |
log |
static String |
STEAL_ALL_ACCOUNTS_COMMAND |
private static String |
UNKNOWN_COMMAND_URL |
static String |
WITHDRAW_COMMAND |
Constructor and Description |
---|
TellerHandlerServlet() |
Modifier and Type | Method and Description |
---|---|
void |
destroy() |
protected void |
doGet(HttpServletRequest request,
HttpServletResponse response)
This is the main dispatch method for the servlet.
|
protected void |
doPost(HttpServletRequest request,
HttpServletResponse response)
Since this is a toy, we don't really care whether they call get or post.
|
void |
init()
Init verify the teller reference to the EJB logic is in place and
initializes the proper handler for the assigned role supplied in
the servlet init parameters.
|
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
private static final org.apache.commons.logging.Log log
public static final String COMMAND_PARAM
public static final String EXCEPTION_PARAM
public static final String HANDLER_TYPE_KEY
public static final String ADMIN_TYPE
public static final String CREATE_ACCOUNT_COMMAND
public static final String DEPOSIT_COMMAND
public static final String WITHDRAW_COMMAND
public static final String GET_ACCOUNT_COMMAND
public static final String CLOSE_ACCOUNT_COMMAND
public static final String GET_ACCOUNTS_COMMAND
public static final String CREATE_ACCOUNTS_COMMAND
public static final String GET_LEDGER_COMMAND
public static final String STEAL_ALL_ACCOUNTS_COMMAND
public static final String jndiName
private static final String UNKNOWN_COMMAND_URL
private Map<String,TellerHandlerServlet.Handler> handlers
private Teller injectedTeller
private Properties env
public void init() throws ServletException
init
in class GenericServlet
ServletException
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
doGet
in class HttpServlet
ServletException
IOException
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
doPost
in class HttpServlet
ServletException
IOException
public void destroy()
destroy
in interface Servlet
destroy
in class GenericServlet
Copyright © 2015 John's Hopkins University, Engineering Programs for Professionals. All rights reserved.