Overview | Package | Class | Tree | Deprecated | Index | Help
| © 2003 BEA Systems, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bea.p13n.content.servlets
Class ShowDocServlet

    java.lang.Object
      |
      +--javax.servlet.GenericServlet
            |
            +--javax.servlet.http.HttpServlet
                  |
                  +--com.bea.content.manager.servlets.ShowPropertyServlet
                        |
                        +--com.bea.content.manager.servlets.ShowBinaryServlet
                              |
                              +--com.bea.p13n.content.servlets.ShowDocServlet

All Implemented Interfaces:
  Serializable, Servlet, ServletConfig

public class ShowDocServlet
extends ShowBinaryServlet

A servlet which will output a document to the client.

This will act like the ShowBinaryServlet. If the Node is not found in the repository, then this will perform the old behavior of using a DocumentManager

This understands 2 init parameters:

- `contentHome`: Specifies the default JNDI content home name. If this is specified, then all contentHome request parameters will be ignored. If contentHome is not specified as either an init or request parameter, the default DocumentManager home will be used (which is "java:comp/env/ejb/DocumentManager").
- `closeStreams`: true to have the servlet close output streams when done, false to not. This defaults to false.

This understands 2 request parameters:

- `contentHome`: Specifies the JNDI content manager home name to look for the document at, if the contentHome init parameters isn't specified.
- `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. This will put the contentHome from the request parameter in the session at `"com.bea.p13n.content.document.contentHome"`.

See Also:
  Serialized Form

Field Summary
`static String` | `CONTENT_HOME_SESSION_NAME` Deprecated. The Session variable this will look for the contentHome in.
`protected String` | `contentHome` Deprecated. The content home.
`static String` | `DEF_MIME_TYPE` Deprecated. The default mime type.

Fields inherited from class com.bea.content.manager.servlets.ShowPropertyServlet
`closeStreams, DEFAULT_MIME_TYPE, TEXT_MIME_TYPE`

Constructor Summary
`ShowDocServlet()` Deprecated.

Method Summary
`void` | `doPost(HttpServletRequest req, HttpServletResponse resp)` Deprecated. Request entry point.
`void` | `init()` Deprecated. Initialize the servlet.
`protected void` | `showError(String error, Throwable ex, HttpServletResponse resp)` Deprecated. Print an error message to the output stream.

Methods inherited from class com.bea.content.manager.servlets.ShowPropertyServlet
`doGet, printNode`

Methods inherited from class javax.servlet.http.HttpServlet
`doDelete, doHead, 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

### DEF_MIME_TYPE

    public static final String DEF_MIME_TYPE

  Deprecated.
  The default mime type.

  See Also:
    Constant Field Values

### CONTENT_HOME_SESSION_NAME

    public static final String CONTENT_HOME_SESSION_NAME

  Deprecated.
  The Session variable this will look for the contentHome in.

  See Also:
    Constant Field Values

### contentHome

    protected String contentHome

  Deprecated.
  The content home.

Constructor Detail

### ShowDocServlet

    public ShowDocServlet()

  Deprecated.

Method Detail

### init

    public void init()
              throws ServletException

  Deprecated.
  Initialize the servlet.

  Overrides:
    `init` in class `ShowPropertyServlet`
    `ServletException`

### doPost

    public void doPost(HttpServletRequest req,
                       HttpServletResponse resp)
                throws ServletException,
                       IOException

  Deprecated.
  Request entry point.

  Override to first try the ShowBinaryServlet method to access the new content repository first. If that fails to find the Node, then this will access a ContentManager.

  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.

  Overrides:
    `doPost` in class `ShowPropertyServlet`
    `ServletException`
    `IOException`

### showError

    protected void showError(String error,
                             Throwable ex,
                             HttpServletResponse resp)
                      throws ServletException,
                             IOException

  Deprecated.
  Print an error message to the output stream.

  This assumes that nothing has been put on the response yet.

  Overrides:
    `showError` in class `ShowPropertyServlet`
  Parameters:
    `error` - the error message.
    `ex` - a possible exception.
    `resp` - the response to output to.
    `ServletException`
    `IOException`

Overview | Package | Class | Tree | Deprecated | Index | Help
| © 2003 BEA Systems, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003 BEA Systems, Inc. All Rights Reserved