# com.bea.content.manager.servlets
ShowPropertyServlet Class

public class ShowPropertyServlet
extends `HttpServlet`

Writes a property of a Node to the response OutputStream. The available paramater options are as follows:

- 1) Pass the node Id in as a request parameter. Eg. http://server:port/app/ShowProperty?nodeId=/repo/12345.
- 2) Pass the node path as part of the the request pathInfo. Eg. http://server:port/app/ShowProperty/repo/path/file.ext.
- 3) Pass the node path in as a request parameter. Eg. http://server:port/app/ShowProperty?nodePath=/repo/path/file.ext

  With any of the above, if you would like to display a property other than the primary property, simply put "//propertyName" at the end of the parameter/pathInfo.

  Hierarchy
    `Object`
    `GenericServlet`
    `HttpServlet`
    `ShowPropertyServlet`
  All Implemented Interfaces
    `Serializable`, `Servlet`, `ServletConfig`
  Direct Known Subclasses
    `ShowBinaryServlet`

  ## Field Summary

  `protected boolean` | `closeStreams` Should we close the output stream when done.
  `public static final `String`` | `DEFAULT_MIME_TYPE` String
  `public static final `String`` | `TEXT_MIME_TYPE` String

  ## Constructor Summary

  ShowPropertyServlet()

  ## Method Summary

  `public void` | `doGet`(`HttpServletRequest` req, `HttpServletResponse` resp)
  `public void` | `doPost`(`HttpServletRequest` req, `HttpServletResponse` resp)
  `public void` | `init`()
  `protected void` | `ioReadWrite`(`InputStream` is, `OutputStream` out)
  `protected byte[]` | `nioRead`(`FileInputStream` is)
  `protected void` | `printNode`(`HttpServletRequest` req, `HttpServletResponse` resp) Prints out the value of the content property from the Node specified in the request.
  `protected void` | `showError`(`String` error, `Throwable` ex, `HttpServletResponse` resp)

  Methods from `javax.servlet.http.`HttpServlet``
  `doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service`

  Methods from `javax.servlet.`GenericServlet``
  `destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log, service`

  Methods from class `java.lang.`Object``
  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  Methods from interface `javax.servlet.`Servlet``
  `destroy, getServletConfig, getServletInfo, init, service`

  Methods from interface `javax.servlet.`ServletConfig``
  `getInitParameter, getInitParameterNames, getServletContext, getServletName`

  ## Field Detail

  ### closeStreams

      protected boolean closeStreams

    Should we close the output stream when done. This will be initialized from the "closeStreams" initialized parameter.

  ### DEFAULT_MIME_TYPE

      public static final String DEFAULT_MIME_TYPE

  ### TEXT_MIME_TYPE

      public static final String TEXT_MIME_TYPE

  ## Constructor Detail

  ### ShowPropertyServlet

      public ShowPropertyServlet()

  ## Method Detail

  ### doGet(HttpServletRequest, HttpServletResponse) Method

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

  Overrides
    `HttpServlet.doGet(HttpServletRequest, HttpServletResponse)`

  #### Exceptions

  ``ServletException``
  ``IOException``

  ### doPost(HttpServletRequest, HttpServletResponse) Method

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

  Overrides
    `HttpServlet.doPost(HttpServletRequest, HttpServletResponse)`

  #### Exceptions

  ``ServletException``
  ``IOException``

  ### init() Method

      public void init()
           throws ServletException

  Overrides
    `GenericServlet.init()`

  #### Exceptions

  ``ServletException``

  ### ioReadWrite(InputStream, OutputStream) Method

      protected void ioReadWrite(InputStream is,
                                 OutputStream out)
           throws IOException

  #### Exceptions

  ``IOException``

  ### nioRead(FileInputStream) Method

      protected byte[] nioRead(FileInputStream is)
           throws IOException

  #### Exceptions

  ``IOException``

  ### printNode(HttpServletRequest, HttpServletResponse) Method

      protected void printNode(HttpServletRequest req,
                               HttpServletResponse resp)
           throws IOException, RepositoryException, IllegalArgumentException, ServletException

  Prints out the value of the content property from the Node specified in the request.

  This will not print any error messages to the response.

  #### Exceptions

  ``IOException``
    thrown on an error printing.
  ``RepositoryException``
    thrown on an error talking to the repository or the Node doesn't have a content property to display.
  ``IllegalArgumentException``
    thrown if the request doesn't contain a valid node path or the node wasn't found.
  ``ServletException``

  ### showError(String, Throwable, HttpServletResponse) Method

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

  #### Exceptions

  ``ServletException``
  ``IOException``