Displaying Images with Cocoon

Time:November 30

Advertisement

I am a bit of a Cocoon Newbie but I have spent a day or two trying to resolve this issue. Here Goes. We are starting to use Cocoon 2.1 and we are replacing a Struts based system that extracts information from a Legacy Database (IDMS) and retrieves among other things JPEG images. With the Struts system we couldn't find a way to use a JSP to display the image so we had to use a servlet. I was under the impression that there might be an easy way to do this in Cocoon but now I'm not so sure. Most of the examples in any Cocoon books are using the inbuilt SQL type features to extract the image but this is not an option for us. Has anyone created a JPEG image object and then diaplayed it using an XSP or maybe just using a servlet. I would appreciate any help from someone who has done this or knows how this can be done.

Advertisement

I actually tried both ways of achieving this and both worked (reader method took quite a while)!
Initially I extended ResourceReader (instead of Image Reader). The difficulty came in getting it to read from a session attribute rather than a URL but I achieved this by overriding the Generate method.
I used the JSP code scriptlet from AslanovSergey and put this in a Cocoon Action. The only tweaking I needed was to flush the output !
To answer your question the JPEGdata was already in a byte array so that code was spot on (apart from the flush ).
Thanks for your help.

Hi all I was installing cocoon with apex as describe at http://carlback.blogspot.com/2007/03/apex-cocoon-pdf-and-more.html but when I have cirilic theres ##### (so I m trying to set APEX_FOP/apache-tomcat-6.0.29/webapps/cocoon/WEB-INF/web.xml from IS

Friends, I integrated Apex with appache with cocoon. Its working fine with reports but i want it to work with form on a table or view.The steps below which i have followed for integrating Apex with Cocoon Steps of pdf Printing of Report with cocoon:

Hi, I have followed Carl's very concise blog on using cocoon for pdf printing. http://carlback.blogspot.com/2007/03/apex-cocoon-pdf-and-more.html I have tomcat and cocoon up and running on linux (NOT a five minute task on linux unless you are a sysad

How do I send a dynamic xml generated by my servlet to cocoon servlet for further processing? We want to display the generated xml(on fly) in html/pdf format in browser. If any one has done something like this, please give your suggestions what to ad

Hi, I'm trying to implement Carl Backstrom's Tomcat-Cocoon-FOP solution. I know its probably a Coccoon/FOP issue... when I click "Test Report" I get the following (see below). I haven't edited anything :), and i'm just trying to output one field

I would like to explain my requirements to you. 1. I will be displaying a Exponential bar chart. The length of bar chart is obatined from Sybase database. 2. This chart should be dynamically created depending on the value on the database and x -axis

I am trying to load a jsp page in my application(struts application). The jsp uses jsf and is loaded from the application mentioned. My web.xml has the following entries: <web-app> <listener> <listener-class>MyListener</listener

Hello Gurus, I have developed a BI report with more number of parameters. Case 1: When i run my report , I am able to see data for particular condition but one column doesn't show any thing. All the rows in the column are blank. Case 2 I tried to put

I have 2009 late model of mac mini, The text on display looks washed out, not clear or sharp at all from day one, I thought it was the old model of monitor, tried the same cable to another monitor on another computer, SAME. so I thought the problem c

I recently purchased a mini-dvi to video adapter for my macbook to be able to view photos and video on my tv. I'm having trouble with the display on my computer when I use the adapter. As soon as I plug in the mini-dvi video adapter into the computer

I recently purchased the mini-dvi to video adapter for my powerbook to use my TV as a monitor and to play pictures and videos from the laptop to the TV. I am getting a full color display on the TV, but it's only the screen saver. None of my files, te

Hi, Apps - 12.1.3 DB 11gr1 OS- RHEL 5.6, 64 bit We have an application which is built using .net , but the database is 11gR1 we are connecting vis ODAC ... it was working good. But when we treid to move to other server, we created a user B , created

My mac is the new Mac book pro 15.4 inch screen and I connect my mac pro to external display e.g. Samsung LCD monitor 24 inches. The bug is that I can not PROPERLY view full screen (in external display) for some application e.g. iTunes, and Front Row

Hi Experts, I have to trigger a mail whenever there is a change in fields that are captured in parameter t_ffbk. However i am unable to capture the the screen values for this parameter as FK03 is in display mode.Please tell me how can i capture the s

Hi, Total is not getting displayed in the ALV output. I m using :REUSE_ALV_BLOCK_LIST_APPEND & REUSE_ALV_BLOCK_LIST_DISPLAY Are there any issues with it as the same settings are working fine with REUSE_ALV_LIST_DISPLAY source code: DATA: layout TYPE

Hi All, I am having a report based on an infoset. This report is displaying the data in the Dev. envmt. When it is transported to the QA, it is not displaying the data in the BEx as well as RSRT, in the QA envmt. The patch levels of both the Dev. an