public class ChartServlet extends HttpServlet
This class requires a javax.servlet
Images are rendered using ImageIO
This class can be used on a headless server. Java runs in a headless mode if the system property
java.awt.headless=true
.
This class turns off caching in the ImageIO class
(calls javax.imageio.ImageIO.setUseCache(false)
).
Constructor and Description |
---|
ChartServlet() |
Modifier and Type | Method and Description |
---|---|
protected void |
doGet(HttpServletRequest request,
HttpServletResponse response)
Returns the chart as a PNG image.
|
protected Chart |
getChart(HttpServletRequest request)
Returns the chart found in the session saved with the
key "chart"+id, where id is the value of the "id" parameter
in the request.
|
void |
init() |
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
doGet
in class HttpServlet
request
- an HttpServletRequest
object that contains
the request the client has made of the servletresponse
- an HttpServletResponse
object that contains the
response the servlet sends to the clientServletException
IOException
protected Chart getChart(HttpServletRequest request)
request
- an HttpServletRequest
object that contains
the request the client has made of the servletJspBean
public void init() throws ServletException
init
in class GenericServlet
ServletException
Copyright © 1970-2015 Rogue Wave Software
Built October 13 2015.