public class FbBotMillServlet
extends javax.servlet.http.HttpServlet
FbBotDefinition in which the initial configuration is done. If not
such class is found or can't be loaded, a ServletException is thrown during
initialization.
The FbBotMillServlet supports GET requests only for the Subscribing phase and
POST requests for all the Facebook callbacks. For more information about how
the communication is handled, check the documentation for doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse),
doPost(HttpServletRequest, HttpServletResponse) and Facebook's
documentation with the link below.| Constructor and Description |
|---|
FbBotMillServlet() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Specifies how to handle a GET request.
|
protected void |
doPost(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Specifies how to handle a POST request.
|
void |
init()
Initializes the FbBotMillServlet.
|
String |
toString() |
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, servicepublic void init()
throws javax.servlet.ServletException
FbBotDefinition passed has an init-param in
the web.xml. If the class is found and correctly loaded, the method
FbBotDefinition.defineBehavior() is called, otherwise a
ServletException is thrown.init in class javax.servlet.GenericServletjavax.servlet.ServletException - if the FbBotDefinition class is not found in the servlet
init-param in web.xml or if can't be load.protected void doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
throws javax.servlet.ServletException,
IOException
FbBotMillNetworkConstants.HUB_MODE_PARAMETER value received equals to
FbBotMillNetworkConstants.HUB_MODE_SUBSCRIBE and that the
FbBotMillNetworkConstants.HUB_VERIFY_TOKEN_PARAMETER value received equals
to the FbBotMillContext.getValidationToken(). If that's true, then
the FbBotMillServlet will reply sending back the value of the
FbBotMillNetworkConstants.HUB_CHALLENGE_PARAMETER received, in order to
confirm the registration, otherwise it will return an error 403.doGet in class javax.servlet.http.HttpServletreq - the reqresp - the respjavax.servlet.ServletException - the servlet exceptionIOException - Signals that an I/O exception has occurred.protected void doPost(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
throws javax.servlet.ServletException,
IOException
MessengerCallback object. If the request is not a
MessengerCallback, then the FbBotMillServlet logs an error and does
nothing, otherwise it will forward the request to all registered bots
in order to let them process the callbacks.doPost in class javax.servlet.http.HttpServletreq - the reqresp - the respjavax.servlet.ServletException - the servlet exceptionIOException - Signals that an I/O exception has occurred.Copyright © 2016 BotMill. All rights reserved.