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.HttpServlet
Abstract 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_APPID
protected java.lang.String
_appid
protected static java.lang.String
APPID_PARAM
protected static java.lang.String
ITEMS_PARAM
protected static java.lang.String
STYLE
-
Constructor Summary
Constructors Constructor Description AbstractRestServlet()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
protected java.lang.String
generateThumbs(java.util.Queue<java.util.Map<java.lang.String,java.lang.String>> results)
void
init(javax.servlet.ServletConfig servletConfig)
protected java.lang.String
ms(long nano)
protected java.lang.String
restURL(java.lang.String item)
static java.lang.String
sanitize(java.lang.String str)
protected int
width(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:
init
in interfacejavax.servlet.Servlet
- Overrides:
init
in 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:
doPost
in classjavax.servlet.http.HttpServlet
- Throws:
javax.servlet.ServletException
java.io.IOException
-
-