Sunday, January 16, 2011

Printing CLOB Object Data in JSP

<tr>
                <td>
                        <PRE><%String line;
                                if (docObj != null) {
                                    BufferedReader in = new BufferedReader(docObj.getDocument().getCharacterStream());
                                    line = in.readLine();
                                    while (line != null) {
                                        line = line.replace(">", "&gt;");
                                        line = line.replace("<", "&lt;");
                                        out.println(line);
                                        out.flush();
                                        line = in.readLine();
                                    }
                                }
                            %>
                         </PRE>
                </td>
            </tr>