|
BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.servlet.GenericServlet | +--javax.servlet.http.HttpServlet | +--com.beasys.commerce.content.ShowDocServlet
A servlet which will output a document to the client.
This understands 2 init parameters:
contentHome
: Specifies the default JNDI content home name.
This is used if contentHome isn't specified in the request. This defaults
to the default document home name (from ContentHelper).
closeStreams
: true to have the servlet close output
streams when done, false to not. This defaults to false.
contentHome
: Specifies the JNDI content home name to look
for the document in. If not specified, then the contentHome init parameter
is used.
contentId
: Specifies the identifier of the document to
display. If not specified, an error message is displayed instead.
"com.beasys.commerce.axiom.document.contentHome"
.
Field Summary | |
protected boolean |
closeStreams
Do we close the output stream when finished. |
static java.lang.String |
CONTENT_HOME_SESSION_NAME
The Session variable this will look for the contentHome in. |
protected java.lang.String |
contentHome
The content home. |
static java.lang.String |
DEF_MIME_TYPE
The default mime type. |
Constructor Summary | |
ShowDocServlet()
|
Method Summary | |
void |
doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Just calls doPost(). |
void |
doPost(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Request entry point. |
void |
init()
Initialize the servlet. |
protected void |
showError(java.lang.String error,
java.lang.Throwable ex,
javax.servlet.http.HttpServletResponse resp)
Print an error message to the output stream. |
Methods inherited from class javax.servlet.http.HttpServlet |
doDelete,
doOptions,
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 java.lang.String DEF_MIME_TYPE
public static final java.lang.String CONTENT_HOME_SESSION_NAME
protected java.lang.String contentHome
protected boolean closeStreams
Constructor Detail |
public ShowDocServlet()
Method Detail |
public void init() throws javax.servlet.ServletException
public void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, java.io.IOException
public void doPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, java.io.IOException
This method gets the contentId and contentHome. From that, it gets a Document object, from which, it outputs the document's content bytes to the output stream.
It will set the Content-Type, Content-Length, and Content-Disposition headers on the response to try to get the browser to do the correct thing.
protected void showError(java.lang.String error, java.lang.Throwable ex, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, java.io.IOException
This assumes that nothing has been put on the response yet.
error
- the error message.ex
- a possible exception.resp
- the response to output to.
|
BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |