com.beasys.commerce.content
Class ShowDocServlet
java.lang.Object
|
+--javax.servlet.GenericServlet
|
+--javax.servlet.http.HttpServlet
|
+--com.beasys.commerce.content.ShowDocServlet
- public class ShowDocServlet
- extends javax.servlet.http.HttpServlet
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 understands 2 request parameters:
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.
This will also check the PATH_INFO for the contentId, if it's not found in
the request parameters.
- See Also:
- Serialized Form
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. |
Methods inherited from class javax.servlet.http.HttpServlet |
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 |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
DEF_MIME_TYPE
public static final java.lang.String DEF_MIME_TYPE
- The default mime type.
CONTENT_HOME_SESSION_NAME
public static final java.lang.String CONTENT_HOME_SESSION_NAME
- The Session variable this will look for the contentHome in.
ShowDocServlet
public ShowDocServlet()
init
public void init()
throws javax.servlet.ServletException
- Initialize the servlet.
- Overrides:
- init in class javax.servlet.GenericServlet
doGet
public void doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
throws javax.servlet.ServletException,
java.io.IOException
- Just calls doPost().
doPost
public void doPost(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
throws javax.servlet.ServletException,
java.io.IOException
- Request entry point.
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.
Copyright © 2000 BEA Systems, Inc. All Rights Reserved