Class AbstractRestServlet
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- org.eclipse.jetty.example.asyncrest.AbstractRestServlet
-
- All Implemented Interfaces:
java.io.Serializable,javax.servlet.Servlet,javax.servlet.ServletConfig
- Direct Known Subclasses:
AsyncRestServlet,SerialRestServlet
public class AbstractRestServlet extends javax.servlet.http.HttpServletAbstract Servlet implementation class AsyncRESTServlet. Enquires ebay REST service for auctions by key word. May be configured with init parameters:- appid
- The eBay application ID to use
- items
- The keyword to search for
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.String__DEFAULT_APPIDprotected java.lang.String_appidprotected static java.lang.StringAPPID_PARAMprotected static java.lang.StringITEMS_PARAMprotected static java.lang.StringSTYLE
-
Constructor Summary
Constructors Constructor Description AbstractRestServlet()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)protected java.lang.StringgenerateThumbs(java.util.Queue<java.util.Map<java.lang.String,java.lang.String>> results)voidinit(javax.servlet.ServletConfig servletConfig)protected java.lang.Stringms(long nano)protected java.lang.StringrestURL(java.lang.String item)static java.lang.Stringsanitize(java.lang.String str)protected intwidth(long nano)-
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPut, doTrace, getLastModified, service, service
-
-
-
-
Field Detail
-
__DEFAULT_APPID
protected static final java.lang.String __DEFAULT_APPID
- See Also:
- Constant Field Values
-
STYLE
protected static final java.lang.String STYLE
- See Also:
- Constant Field Values
-
ITEMS_PARAM
protected static final java.lang.String ITEMS_PARAM
- See Also:
- Constant Field Values
-
APPID_PARAM
protected static final java.lang.String APPID_PARAM
- See Also:
- Constant Field Values
-
_appid
protected java.lang.String _appid
-
-
Method Detail
-
init
public void init(javax.servlet.ServletConfig servletConfig) throws javax.servlet.ServletException- Specified by:
initin interfacejavax.servlet.Servlet- Overrides:
initin classjavax.servlet.GenericServlet- Throws:
javax.servlet.ServletException
-
sanitize
public static java.lang.String sanitize(java.lang.String str)
-
restURL
protected java.lang.String restURL(java.lang.String item)
-
generateThumbs
protected java.lang.String generateThumbs(java.util.Queue<java.util.Map<java.lang.String,java.lang.String>> results)
-
ms
protected java.lang.String ms(long nano)
-
width
protected int width(long nano)
-
doPost
protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException- Overrides:
doPostin classjavax.servlet.http.HttpServlet- Throws:
javax.servlet.ServletExceptionjava.io.IOException
-
-