public final class RecommenderServlet
extends javax.servlet.http.HttpServlet
A servlet which returns recommendations, as its name implies. The servlet accepts GET and POST HTTP requests, and looks for two parameters:
The response is text, and contains a list of the IDs of recommended items, in descending order of relevance, one per line.
For example, you can get 10 recommendations for user 123 from the following URL (assuming
you are running taste in a web application running locally on port 8080):
http://localhost:8080/taste/RecommenderServlet?userID=123&howMany=10
This servlet requires one init-param in web.xml: it must find
a parameter named "recommender-class" which is the name of a class that implements
Recommender and has a no-arg constructor. The servlet will instantiate and use
this Recommender to produce recommendations.
| Constructor and Description |
|---|
RecommenderServlet() |
| Modifier and Type | Method and Description |
|---|---|
void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
void |
doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
void |
init(javax.servlet.ServletConfig config) |
String |
toString() |
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, servicepublic void init(javax.servlet.ServletConfig config)
throws javax.servlet.ServletException
init in interface javax.servlet.Servletinit in class javax.servlet.GenericServletjavax.servlet.ServletExceptionpublic void doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException
doGet in class javax.servlet.http.HttpServletjavax.servlet.ServletExceptionpublic void doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException
doPost in class javax.servlet.http.HttpServletjavax.servlet.ServletExceptionCopyright © 2008–2013 The Apache Software Foundation. All rights reserved.