BEA Systems, Inc.

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:

closeStreams: true to have the servlet close output streams when done, false to not. This understands 2 request parameters: This will also check the PATH_INFO for the contentId, if it's not found in the request parameters.

See Also:
Serialized Form

Field Summary
static java.lang.String CONTENT_HOME_SESSION_NAME
          The Session variable this will look for the contentHome in.
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.
 
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
 

Field Detail

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.
Constructor Detail

ShowDocServlet

public ShowDocServlet()
Method Detail

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.


BEA Systems, Inc.

Copyright © 2000 BEA Systems, Inc. All Rights Reserved