Current position:  Home > Default > Displaying Images with Cocoon

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.

Cocoon 2.1.11 pdf dont display cirilic?

-0001-11-30

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

External-graphic not shown in PDF with Tomcat / Cocoon / Ubuntu

2015-10-11

Hi, this weekend I set up a virtualbox with Ubuntu 8.04 OS; APEX 3.12 @ Oracle 10gXE; Tomcat 6.014; Cocoon 2.1.11; fop_post sitemap file according to Carl Backstrom blogpost ([http://carlback.blogspot.com/2007/03/apex-cocoon-pdf-and-more.html]); to e

Integrating Apex with Cocoon (does it make pdf from taking data from DB)

2015-10-11

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:

Cocoon pdf printing

2015-10-11

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

Cocoon 1.8.2 and weblogic 6.1

-0001-11-30

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

Cocoon-FOP Output Problem

-0001-11-30

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

Displaying BAR chart using JSPChart , Sysbase database, Jrun server

-0001-11-30

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

Error thrown : Context must be instance of org.apache.cocoon.environment.

-0001-11-30

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

Re: Column is not getting displayed in the BI report

2015-10-11

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

Using mini-DVI to VGA adapter to Samsung display

2015-10-11

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

Mini-dvi to video adapter changing display on macbook?

2015-10-11

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

Display problems using mini-dvi to video adapter

2015-10-11

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

View the .rtf file not display the data in BI Publisher Enterprise.

2015-10-11

Hi, Platform: OBIEE 10g in NT XPsp2 View the .rtf file not display the data in BI Publisher Enterprise. Step 1, I created Answer-request, create .rtf file with Word and add the request name, Add bar chart and table, preview PDF is working fine with d

View not displaying the data in some of the clients

2015-10-11

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

Can not properly view cover flow in full screen in external display

2015-10-11

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

Strange scenario,Oracle can not display the data in mysql correctly

2015-10-11

I use Heterogeneous Service+ODBC to achieve "oracle access mysql"(any other method?),and now i find Oracle can not display the data in mysql correctly: -------mysql------------ mysql> create table tst(id int,name varchar(10)); Query OK, 0 row

Unable to capture value inside parameter T_LFBK of FK03 in display mode

2015-10-11

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

Total is not getting displayed in the ALV output.

2015-10-11

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

Data is not getting displayed in the report from an Infoset.

2015-10-11

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