public class SpeechletServlet
extends javax.servlet.http.HttpServlet
Simple implementation of a skill in the form of a Java EE servlet. Use this class when coding the skill as a web service.
This class takes care of the JSON serialization / deserialization of the HTTP body and the
invocation of the right method of the provided SpeechletV2 . It also handles sending back
modified session attributes, user attributes and authentication tokens when needed and handles
exception cases.
SpeechletV2,
setSpeechlet(SpeechletV2),
Serialized Form| Constructor and Description |
|---|
SpeechletServlet() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Handles a POST request.
|
Speechlet |
getSpeechlet()
Returns the
Speechlet object that this servlet uses. |
SpeechletV2 |
getSpeechletV2()
Returns the
SpeechletV2 object that this servlet uses. |
void |
setSpeechlet(Speechlet speechlet)
Sets the
Speechlet object that this servlet uses. |
void |
setSpeechlet(SpeechletV2 speechlet)
Sets the
SpeechletV2 object that this servlet uses. |
doDelete, doGet, doHead, doOptions, doPut, doTrace, getLastModified, service, serviceprotected void doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws IOException
SpeechletV2.doPost in class javax.servlet.http.HttpServletrequest - the object that contains the request the client has made of the servletresponse - object that contains the response the servlet sends to the clientIOException - if an input or output error is detected when the servlet handles the requestpublic Speechlet getSpeechlet()
Speechlet object that this servlet uses.Speechlet associated with this servlet, or null if there is not onepublic SpeechletV2 getSpeechletV2()
SpeechletV2 object that this servlet uses.SpeechletV2 object that this servlet uses.public void setSpeechlet(Speechlet speechlet)
Speechlet object that this servlet uses.speechlet - the Speechlet to associate with this servletpublic void setSpeechlet(SpeechletV2 speechlet)
SpeechletV2 object that this servlet uses.speechlet - the SpeechletV2 to associate with this servletCopyright © 2016. All rights reserved.