|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.rhq.enterprise.gui.common.servlet.ParameterizedServlet
org.rhq.enterprise.gui.common.servlet.ImageServlet
public abstract class ImageServlet
This servlet returns a response that contains the binary data of an image (JPEG or PNG) that can be viewed in a web browser.
The navigation map servlet takes the following parameters (any applicable defaults are in bold and required parameters are in italics):
| key | value |
|---|---|
| imageFormat | (png | jpeg) |
| imageWidth | <integer (700)> |
| imageHeight | <integer (350)> |
| Field Summary | |
|---|---|
static String |
IMAGE_FORMAT_JPEG
Request parameter value representing a JPEG image. |
static String |
IMAGE_FORMAT_PARAM
Request parameter for image format. |
static String |
IMAGE_FORMAT_PNG
Request parameter value representing a PNG image. |
static int |
IMAGE_HEIGHT_DEFAULT
Default image height. |
static String |
IMAGE_HEIGHT_PARAM
Request parameter for image height. |
static int |
IMAGE_WIDTH_DEFAULT
Default image width. |
static String |
IMAGE_WIDTH_PARAM
Request parameter for image width. |
| Constructor Summary | |
|---|---|
ImageServlet()
|
|
| Method Summary | |
|---|---|
protected abstract Object |
createImage(javax.servlet.http.HttpServletRequest request)
Create the image being rendered. |
void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
|
protected String |
getDefaultImageFormat()
Return the default imageFormat. |
protected int |
getDefaultImageHeight()
Return the default imageHeight. |
protected int |
getDefaultImageWidth()
Return the default imageWidth. |
protected String |
getImageFormat()
Return the image format. |
protected int |
getImageHeight()
Return the image height. |
protected int |
getImageWidth()
Return the image width. |
void |
init()
|
protected void |
parseParameters(javax.servlet.http.HttpServletRequest request)
This method will be called automatically by the ImageServlet. |
protected abstract void |
renderJpegImage(javax.servlet.ServletOutputStream out,
Object imgObj)
Render a JPEG version of the image into the output stream. |
protected abstract void |
renderPngImage(javax.servlet.ServletOutputStream out,
Object imgObj)
Render a PNG version of the image into the output stream. |
| Methods inherited from class javax.servlet.http.HttpServlet |
|---|
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service |
| Methods inherited from class javax.servlet.GenericServlet |
|---|
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String IMAGE_FORMAT_PARAM
public static final String IMAGE_FORMAT_PNG
public static final String IMAGE_FORMAT_JPEG
public static final String IMAGE_WIDTH_PARAM
public static final int IMAGE_WIDTH_DEFAULT
public static final String IMAGE_HEIGHT_PARAM
public static final int IMAGE_HEIGHT_DEFAULT
| Constructor Detail |
|---|
public ImageServlet()
| Method Detail |
|---|
public void init()
init in class javax.servlet.GenericServlet
public void doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException
doGet in class javax.servlet.http.HttpServletjavax.servlet.ServletException
protected abstract Object createImage(javax.servlet.http.HttpServletRequest request)
throws javax.servlet.ServletException
request - the servlet request
javax.servlet.ServletException
protected abstract void renderPngImage(javax.servlet.ServletOutputStream out,
Object imgObj)
throws IOException
out - the output stream
IOException
protected abstract void renderJpegImage(javax.servlet.ServletOutputStream out,
Object imgObj)
throws IOException
out - the output stream
IOExceptionprotected void parseParameters(javax.servlet.http.HttpServletRequest request)
request - the HTTP request objectprotected String getImageFormat()
IMAGE_FORMAT_PNG or IMAGE_FORMAT_JPEGprotected int getImageHeight()
{@link IMAGE_HEIGHT_DEFAULT}protected int getImageWidth()
{@link IMAGE_WIDTH_DEFAULT}protected String getDefaultImageFormat()
imageFormat.
protected int getDefaultImageWidth()
imageWidth.
protected int getDefaultImageHeight()
imageHeight.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||