apache > cocoon

- Home

# JSP Reader in Cocoon

## JSPReader

NAME | jsp
WHAT | The `JSPReader` component is used to serve JSP page output data in a sitemap pipeline.
TYPE | Reader, Sitemap Component
BLOCK | Jsp
CLASS | org.apache.cocoon.reading.JSPReader
SINCE | Cocoon 2.0
CACHEABLE | no

## Description

The `JSPReader` forwards requests to a JSP engine, and passing the JSP response immediatly as is.

## Usage

The `JSPReader` is useful iff you want to serve the JSP response without any further Cocoon processing steps.

### Sitemap pipeline examples

The following sitemap snippet uses the `JSPReader` to feed `htm` requests by JSP files.

    ...
    <map:match pattern="*.htm">
      <map:read type="jsp" src="{1}.jsp" mime-type="text/html" />
    </map:match>
    ...

### Sitemap component configuration example

    <map:readers...
      <map:reader name="jsp"
        src="org.apache.cocoon.reading.JSPReader"
        logger="sitemap.reader.jsp"
      />
    ...

### Configuration

The `JSP Reader` has no configuration options.

### Setup

The `JSP Reader` has no setup options.

### Effect on Object Model and Sitemap Parameters

## Bugs/Caveats

The `JSP Reader` depends on the accessibilty of a `JSP` engine from within the Cocoon servlet. A JSP must be properly configured for using the `JSP Reader`.

## History

12-25-02: created initial version by Bernhard Huber

## See also

Feeding JSP and passing the content into further Cocoon processing the JSPGenerator is appropriate for this task.

Moreover setting up a preprocessing Servlet Filter would be the most general solution to feeding JSP content.

Errors and Improvements? If you see any errors or potential improvements in this document please help us: View, Edit or comment on the latest development version (registration required).