© 2005 BEA Systems, Inc.

com.bea.p13n.content.servlets
Class ShowDocServlet

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended bycom.bea.content.manager.servlets.ShowPropertyServlet
              extended bycom.bea.content.manager.servlets.ShowBinaryServlet
                  extended bycom.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:

This understands 2 request parameters: 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, ioReadWrite, nioRead, 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

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.


DEF_MIME_TYPE

public static final String DEF_MIME_TYPE
Deprecated. 
The default mime type.

See Also:
Constant Field Values
Constructor Detail

ShowDocServlet

public ShowDocServlet()
Deprecated. 
Method Detail

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
Throws:
ServletException
IOException

init

public void init()
          throws ServletException
Deprecated. 
Initialize the servlet.

Overrides:
init in class ShowPropertyServlet
Throws:
ServletException

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.
Throws:
ServletException
IOException

© 2005 BEA Systems, Inc.

Copyright © 2005 BEA Systems, Inc. All Rights Reserved