Display Image from buffer Image

Hi,
I have bufferdImage I want to display the bufferedImage in my jsp page. Displaing the images is a part of the page. Is it possible to pass the bufferedImage data to servlet and using the servlet Can I display the image by just calling the Servlet from jsp.

Get2win4world wrote:
Hi,
I have bufferdImage I want to display the bufferedImage in my jsp page. Displaing the images is a part of the page. Is it possible to pass the bufferedImage data to servlet and using the servlet Can I display the image by just calling the Servlet from jsp.Apparently, that is the appropriate process of doing it.
You need to think of encoding respective image format and you can stream the output through a servlet and use *<img/>* tags to call the servlet URL accordingly.
Please findout the below example where we are using JPEGImage encoding and making an attempt to stream the image.
package com.krim.utility.servlet;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import com.sun.image.codec.jpeg.JPEGImageEncoder;
import com.sun.image.codec.jpeg.JPEGCodec;
import java.awt.image.BufferedImage;
public class SimpleImageServlet extends HttpServlet {
        protected void processAction(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException {
                BufferedOutputStream out = null;           
                BufferedImage myImage = null;               
                ByteArrayOutputStream bos = null;
                byte imageBuffer[] = null;
                JPEGImageEncoder jpg = null;
               try{
                 myImage = (BufferedImage)request.getAttribute("bufferedImage"); 
                 bos = new ByteArrayOutputStream();
                 jpg = JPEGCodec.createJPEGEncoder(bos);
                 jpg.encode(image);
                 imageBuffer = bos.toByteArray();
                 out = new BufferedOutputStream(response.getOutputStream(),imageBuffer.length);
                 response.setContentType("image/jpeg");
                 response.setContentLength(bos.size());
                 out.write(imageBuffer);
                 out.flush();
           }catch(Exception exp){
                throw ServletExeption(exp.getMessage());
           } finally{
                if(out != null)
                 try(out.close();)catch(Exception e){}
               if(bos != null)
                 try(bos.close();)catch(Exception e){}
               jpg = null;
               imageBuffer = null;
        protected void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException {
             processAction(request,response);
        protected void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException {
             processAction(request,response);
}Usage in jsp can be like the below where we have a action that could be called with a unique ID which can fetch appropraite BufferedImage.
<img src="<%=request.getContextPath()%>/image?id=XXXXYYYZZZ"/>In the same way you can think of implementing similar thing for formats like PNG,GIF & etc...According to your requirement and need of the situation.
Hope that helps :)
REGARDS,
RaHuL

Similar Messages

  • Display image in flex from database

    I am using flex and java and mysql,
    I upload image file into database from flex application.Now i want to display image in my flex
    RIA application from database.
    How can i do that??
    Thanks in advance!!!

    "B.O.H.R." <[email protected]> wrote in
    message
    news:g91dr3$b0f$[email protected]..
    >
    quote:
    > Ordinary Flex can't do this. You could probably do it in
    AIR. There's a
    > separate forum just for AIR applications.
    >
    >
    > Could you precise which things flex CAN'T ?:
    >
    > 1. load image file from local disk and represent it as
    an object in Flex
    > app?
    > 2. display image represented as object(created as above)
    in Flex app?
    > 3. transfer that object back and forth to database using
    BlazeDS ?
    >
    > Maybe there are posibilitie to make workaround of some
    inconviniences?
    > I am asking becaouse I realy would like to create such
    app in Flex.
    Flex can create an AIR application.
    But a swf file can't read from the local drive.
    HTH;
    Amy

  • Display image in report from BLOB

    Hi All,
    i have one requirement i.e
    i want to display image in a report base on condition
    like if id =1 then firest image, id = 2 then second image and id =3 then third image
    i have image in database in BOLB type
    i need to display in report based on that condition
    please help me this requirement is urgent
    reg,
    jell

    just create a query like this:
    select id, image_name, image
    from tablethen your XML output would be like this:
    <ROWSET>
         <ROW>
              <ID>1</ID>
              <IMAGE_NAME>kljkla</IMAGE_NAME>
              <IMAGE>Lots of characters that represents the BLOB</IMAGE>
         </ROW>
         <ROW>
              <ID>2</ID>
              <IMAGE_NAME>jdkwel</IMAGE_NAME>
              <IMAGE>Lots of characters that represents the BLOB</IMAGE>
         </ROW>
         <ROW>
              <ID>3</ID>
              <IMAGE_NAME>oled</IMAGE_NAME>
              <IMAGE>Lots of characters that represents the BLOB</IMAGE>
         </ROW>
         <ROW>
              <ID>4</ID>
              <IMAGE_NAME>mlish</IMAGE_NAME>
              <IMAGE>Lots of characters that represents the BLOB</IMAGE>
         </ROW>
    </ROWSET>in your RTF you put this:
    <fo:instream-foreign-object content-type="image/jpg" width="251.8pt" height="174.3pt" xdofo:alt="picture"><xsl:value-of select=".//IMAGE"/></fo:instream-foreign-object>the attributes width and height are optional

  • How to display images from BLOB column via APEX 4.0

    Hello,
    I did the following in order to display images of two Oracle records on the APEX page. I am using APEX Version : 4.0.1.00.03 , Oracle DB Version : 10.2.0.4.0.
    1. Created An oracle table TEST_FORM
    with 3 columns
    ( ID number, MIME_TYPE varchar2(255) , Image BLOB )
    2. Inserted two records
    10001, image/gif, ( actual image1)
    10002, image/gif, ( actual image2)
    3. created an Oracle procedure
    CREATE OR REPLACE PROCEDURE show_my_form ( p_image_id IN test_form.id%type) AS
    l_mime test_form.mime_type%type;
    l_length NUMBER;
    l_file_name VARCHAR2 (2000);
    lob_loc test_form.IMAGE%type;
    BEGIN
    SELECT mime_type, IMAGE
    , DBMS_LOB.getlength (IMAGE)
    INTO l_mime, lob_loc, l_length
    FROM test_form
    WHERE id = p_image_id;
    owa_util.mime_header(l_mime, false);
    htp.p ('Content-length: ' || l_length);
    owa_util.http_header_close;
    wpg_docload.download_file (lob_loc);
    END show_my_form ;
    4. In Apex 4.0
    step1. Created an interactive report on a new APEX page
    step2. Specified the following in the Region Source
    select id, mime_type, '<img src="#OWNER#.show_my_form ?p_image_id=#ID#" />' photo
    from TEST_FORM
    The column result shows as <img src="CCS.show_my_form?p_image_id=#ID#" />
    I am unable to display the column image as a link to a proper image photo.
    Could you please advise me if I missed anything ?
    Thanks a lot.
    Regards
    Susanna
    Edited by: user10318332 on 13/12/2010 15:51
    Edited by: user10318332 on 13/12/2010 20:10

    Maybe the space you have before the ? is causing issues. there shouldn't be any space.
    Your procedure looks to be much the same of one that I have.
    Have you granted execute on your procedure?
    Also, what version DB are you running? This could be another issue: http://daust.blogspot.com/2006/04/xe-calling-stored-procedures.html
    But anyway, you don't need to create your own procedure these days. You could do the following:
    in your query, have a column: dbms_lob.getlength(blob) photo ; save, then in column attributes for that column, apply a format mask. There is usually a link below the text box for the format mask - BLOB Download Format Mask, which will help you build the format mask. But it is documented here: http://download.oracle.com/docs/cd/E17556_01/doc/user.40/e15517/advnc.htm#BCGGJHEF
    Ta,
    Trent

  • Using flash to display images from sql server or file system

    hello,
    what methods and parameters of the urlloader class we have to use to display images in a flash player if possible..
    also movie should update everytime a new image is added to a database or file
    the images can either be in a file system or in a sql database (if possible)
    does flash comes with an object of this type or we have to create it.
    regards,

    i responded to your duplicate message 4 days ago:
    is it possible to insert and retrieve images from sql server using actionscript.
    you'll need server-side script to query your database and you can use the flash urlloader class to call your script.
    also  is it possible to create a flash scrolling gallery based on images  stored in a database and everytime an image is added it is displayed in  the gallery.
    load the data using the urlloader class and  then load the images.  periodically query the database for new images if  there's no direct way for flash to know a new image was added.

  • Displaying image from Database with php

    Hello everybody,
    I'm working on a website that displays videos courses and tutorials as my final project
    and I'm working with "Flash builder 4" the database with mySQL and the application server with php
    Basically, the goal is to display a datagrid that shows the manager of the website in column all the information stored on the "Course" table
    the structure of the table is :
    Course (id,img,src,title,description)
    -id : primary key
    -img : path to a photo of course {for example picture of JAVA}
    -src : path to the playlist file {xml file}
    -title : String
    -description : String too
    I already succeeded to display all these contents on a DataGrid, but not with the image, I couldn't display an imageon its column using the path stored on the database, I used a DataRenderer to do that, and here is my code for Renderer and the DataGrid.mxml
    CourseGrid.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
       xmlns:s="library://ns.adobe.com/flex/spark"
       xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" xmlns:courseservice="services.courseservice.*">
    <fx:Script>
    <![CDATA[
    import Renderers.CourseDeleteRenderer;
    import Renderers.CourseImageRenderer;
    import mx.controls.Alert;
    import mx.events.FlexEvent;
    protected function dataGrid_creationCompleteHandler(event:FlexEvent):void
    getAllCourseResult.token = courseService.getAllCourse();
    ]]>
    </fx:Script>
    <fx:Declarations>
    <s:CallResponder id="getAllCourseResult"/>
    <courseservice:CourseService id="courseService" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor="true"/>
    <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <mx:DataGrid x="10" y="10" id="dataGrid"
    creationComplete="dataGrid_creationCompleteHandler(event)"
    dataProvider="{getAllCourseResult.lastResult}"
    width="100%">
    <mx:columns>
    <mx:DataGridColumn headerText="" dataField="img" sortable="false" itemRenderer="Renderers.CourseImageRenderer"/>
    <mx:DataGridColumn headerText="id" dataField="id"/>
    <mx:DataGridColumn headerText="src" dataField="src"/>
    <mx:DataGridColumn headerText="title" dataField="title"/>
    <mx:DataGridColumn headerText="description" dataField="description"/>
    <mx:DataGridColumn headerText="Delete" itemRenderer="Renderers.CourseDeleteRenderer"/>
    <mx:DataGridColumn headerText="Update" itemRenderer="Renderers.CourseUpdateRenderer"/>
    </mx:columns>
    </mx:DataGrid>
    </s:Application>
    CourseImageRenderer.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <s:MXDataGridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
      xmlns:s="library://ns.adobe.com/flex/spark"
      xmlns:mx="library://ns.adobe.com/flex/mx"
      focusEnabled="true">
    <mx:Image source="{data}" width="60" height="60"/>
    </s:MXDataGridItemRenderer>
    Result :
    Problem :
    How can I access to the path of the image, I tried to write "data.img" instead of "data" as img is the name of the column in the database that stores the path but it wasn't successful.
    I know that it not complete statement "data" because "data" is a reference to what the DataGrid provides of information that gets from the (CreationComplete) event.
    Question :
    - Can you please help me with this so I can complete displaying images by accessing to what is on the column in tha DB so I can manipulate my datas that is stored there ?
    ==> I still have some questions about the buttons to update and delete datas fomr the DataGrid, but, until now I need to access successfully to the photo and display it
    Thank you,

    Anyone that can help me with this ?
    Please, try this with me, I'm asking Flex developpers this might be easy for you !
    It's just question of how to access the string stored in the variable "data", when I used XML I just type the path to the repeated element like this :
    XML file :
    XML File
    <parent>
    <child>
    <repeated_child></repeated_child>
    <repeated_child></repeated_child>
    <repeated_child></repeated_child>
    </child>
    </parent>
    I used a Model as a reference to the xml file
    and an arrayList as a container of the repeated child
    I just write in the code "data.parent.repeated_child" to access the text in the "repeated_child"
    and here is the code, that I implemented to generate videos from xml file to display a video play list
    Video Playlist code(extract from XML file "data.xml")
    <fx:Declarations>
    <fx:Model id="model" source="assets/data.xml"/>
    <s:ArrayList id="products" source="{model.video}"/>
    </fx:Declarations>
    <mx:List  dataProvider="{products}" labelField="title"
      change="list1_changeHandler(event,List(event.currentTarget).selectedItem)" x="103" y="77" height="350" width="198"/>
    That was my goal to do that with the database.
    Please help me
    If you have other solution I still need it.
    Thank you,

  • Displaying image from database table.

    Hi All,
       I am very new to Web Dynpro ABAP.
      I am developing an application to display an image in "Image" UI Element.
      For this I have one table consisting of fields image id, image data and image name. here image id is primary key field.
    Now i want to display an image from that table in "Image" UI Element. For this i am using "Filedown load" UI element.
    But by using filedownload ui element i can diaplay image in another new page.
    But my requirement is to display image in the same web page without creating a new one.
    (I want to display the image in "Image" UI element without storing that image in MIME objects.)
    Can anyone help me.
    Thanks in Advance!
    Regards,
    Sreelakshmi.

    What you describe is completely possible.  Since you have the image data (XSTRING) in the context you have everything you need.  You don't need to store the content into the MIME Repository, but you do need to get it somewhere where it has an externally accessible URL.  Remember you need to supply image UI element with a URL.  This URL is processed on the client side by the web browser.  Therefore just giving it a path to the context won't work as that isn't externally accessible.
    I would suggest instead that you place the image content into the ICM cache temporarily.  This lets you basically generate a temporary URL for the image that can be used by the Image UI element. 
    Here is some example code that pushes images into the ICM Cache:
    ****Create the cached response object that we will insert our content into
      DATA: cached_response TYPE REF TO if_http_response.
      CREATE OBJECT cached_response
        TYPE
          cl_http_response
        EXPORTING
          add_c_msg        = 1.
       try. " ignore, if compression can not be switched on
          call method cached_response->set_compression
            exporting
              options = cached_response->co_compress_based_on_mime_type
            exceptions
              others  = 1.
        catch cx_root.
      endtry.
    ****set the data and the headers
      DATA: l_app_type TYPE string.
      DATA: l_xstring TYPE xstring.
          cached_response->set_data( me->gx_content ).
          l_app_type = me->gx_mimetype
      cached_response->set_header_field( name  = if_http_header_fields=>content_type
                                         value = l_app_type ).
    ****Set the Response Status
      cached_response->set_status( code = 200 reason = 'OK' ).
    ****Set the Cache Timeout - 60 seconds - we only need this in the cache
    ****long enough to build the page and allow the Image on the Client to request it.
      cached_response->server_cache_expire_rel( expires_rel = I_CACHE_TIMEOUT ).
    ****Create a unique URL for the object
      DATA: guid TYPE guid_32.
      CALL FUNCTION 'GUID_CREATE'
        IMPORTING
          ev_guid_32 = guid.
      CONCATENATE i_path '/' guid '.' i_format INTO r_url.
    ****Cache the URL
      cl_http_server=>server_cache_upload( url      = r_url
                                           response = cached_response ).

  • Problem Displaying image from blob

    Hi all,
    I m using,
    Database : 10g Rel 2
    Frontend : DevSuite 10g
    OS : WinXp
    Browser : IE 6
    Problem : In my forms i m displaying images from blob column but some of the images are not displayed. I have tried with all image formats available in combination with all available display quality but no luck. What could be the reason for it and how do i solve it?
    Can anyone help me plz?
    Thnx in advance.
    Imtiaz

    Hello,
    It is very difficult for us to "guess" what images you can read and what others you cannot.
    Maybe you could provide more information on images that are not displayed ?
    What is their native format ?
    Francois

  • HT1553 I restored my hard drive from time machine. Why is iPhoto not displaying images properly?

    I restored my hard drive from time machine after power blinks corrupted the file system so badly that disk utility could not repair it. Since then, iPhoto has not displayed images correctly. Events are there, and blank squares are shown, but that's all. I rebuilt small and all thumbnails and permissions -- I think the top three or four options in the iPhoto rebuild utility, which took five hours to do but which seems not to have changed anything. The iPhoto library is still more than 100GB, so the photos are there. I didn't choose rebuild from backed up --- whatever the final option on the rebuild menu offers -- because that seems to be appropriate only when a backup is interrupted. Could certainly do it, though. How do I get iphoto behaving again? I have full time machine backups saved automatically and another fairly recent copy on a separate hard drive stored remotely. Thanks for whatever help anyone can provide. I've looked at existing questions and solutions without success so far.

    What version of iPhoto and system are your running?  Since you've tried rebuilding with iPhoto give this a try:
    Using iPhoto Library Manager  to Rebuild Your iPhoto Library
    Download iPhoto Library Manager and launch.
    Click on the Add Library button, navigate to your Home/Pictures folder and select your iPhoto Library folder.
    Now that the library is listed in the left hand pane of iPLM, click on your library and go to the File ➙ Rebuild Library menu option
    In the next  window name the new library and select the location you want it to be placed.
    Click on the Create button.
    Note: This creates a new library based on the LIbraryData.xml file in the library and will recover Events, Albums, keywords, titles and comments. However, books, calendars, cards and slideshows will be lost. The original library will be left untouched for further attempts at fixing the problem or in case the rebuilt library is not satisfactory.
    If you have an external HD you might want to have the rebuilt copy created on it unless you have well more than 100 GB available on your boot drive.
    OT

  • How to display Image as Error instead of Error Message from Resource Bundle

    hi,
    I want to display images as error instead of error message from Application Properties in struts1.1
    Ex:
    I want to prompt a user to type password length min. of 6 char. If failed, need to show simple image as error rather
    "Length should be min. 6".
    reagrds
    parthiban.

    BalusC wrote:
    RahulSharna wrote:
    in the respective resource bundle modify the value by something was below
    error.password.length=<img src="/images/password-Length.gif" alt="Password Length Issue" align="center"/>
    OK, it apparently allows HTML in error messages.Yes struts allows it :)

  • Displaying images from ORDSYS.ORDIMAGE columns

    Does anyone know, if Oracle9i Reports can display images fetched from ORDIMAGE columns in the database? If so, could you give me a brief explanation how?
    Thanks in advance!

    Jacob,
    As of now , it is not supported. It is under development for next release.
    It currently supports images stored in DB as LOBs
    Thanks
    The Oracle Reports team

  • My iphone 4s suddenly displays images from Yahoo, Google, and Flickr at low resolution. The camera on my phone works fine, but any web related photo content is now pixelated and low res, what's the deal?

    My iphone 4s suddenly displays images from Yahoo, Google, and Flickr at a low resolution. I have IOS 7.0.4. My phone camera works fine, but any web based photo content from Safari, Yahoo images, Google images, and Flickr all come in pixelated and low res. What's the deal?

    It happened to me but later I figured out that cellular signal was not that great and so the Internet was very slow. It took me about 2 minutes to get the full resolution picuture on either of the app you've described. Try to get faster internet either by wifi or good signal and then check.

  • XML to display image from userDirectory

    Hi All,
    I've been racking my brain for weeks now trying to work out how to do the following. I can do some of it in Flash and some of in Flex, but I can't do it all in Flex which is frustrating.
    In a nutshell, I want to create an Air App that will allow me to load an XML file from:
    File.userDirectory
    and then display images or SWF's based on the XML data:
    ============
    <?xml version="1.0" encoding="utf-8"?>
    <GALLERY>
    <IMAGE TITLE="shop">test_4.swf</IMAGE>
    </GALLERY>
    ===========
    In Flex 3 I can get the XML file loading from the userDirectory no problem, but I can't work out how to code it to display the images on the stage.
    In Flash I can get the XML file loading from the app's installation directory only, but I can display the images on the stage.
    Here are the two lots of code:
    FLASH (Note: I have a few movieclips holding the images)
    =============
    var myXML:XML;
    var myLoader:URLLoader = new URLLoader();
    myLoader.load(new URLRequest("example.xml"));
    myLoader.addEventListener(Event.COMPLETE, processXML);
    function processXML(e:Event):void {
    myXML = new XML(e.target.data);
    //trace(myXML.IMAGE);
    for (var i:int = 0; i<myXML.*.length(); i++) {
      trace("My image number is " + (i+1) + ", it's title is " + myXML.IMAGE[i].@TITLE + " and it's URL is " + myXML.IMAGE[i]);
      var url:URLRequest = new URLRequest(myXML.IMAGE[i]);
      var loader:Loader = new Loader();
      loader.load(url);
      switch (i) {
       case 0 :
        trace(0);
        mc_container_0.addChild(loader);
        break;
       case 1 :
        trace(1);
        mc_container_1.addChild(loader);
        break;
       case 2 :
        trace(2);
        mc_container_2.addChild(loader);
        break;
       default :
        //trace("Not 0, 1, or 2");
    =======================
    and:
    FLEX 3
    =======================
    <?xml version="1.0" encoding="utf-8"?>
    <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical"
    width="768" height="1366" xmlns:comp="*" xmlns:fmtComp="fmtComps.*"
    creationComplete="readXMLContent();" paddingLeft="0" paddingRight="0" paddingTop="0" paddingBottom="0" backgroundColor="#ff00ff">
    <mx:Script>
    <![CDATA[
    import mx.controls.Alert;
    import mx.utils.ObjectProxy;
    import mx.rpc.events.ResultEvent;
    [Bindable]
    private var userManualObj:ObjectProxy;
    private function loadModelData(event:ResultEvent):void
    userManualObj=event.result.UserManual;
    private function readXMLContent():void
    var reportDir:File = File.userDirectory.resolvePath("myassets");
    var xmlFile:File;
    var fileStream:FileStream = new FileStream();
    xmlFile = reportDir.resolvePath("example.xml");
    if(xmlFile.exists && xmlFile.size > 0)// Checking if the UserGuide.xml file already exists and the file is not empty
    var stream:FileStream = new FileStream();
    var xml:XML = new XML();
    stream.open(xmlFile, FileMode.READ);
    xml = XML(stream.readUTFBytes(stream.bytesAvailable));
    var strXml:String = xml.toXMLString();
    Alert.show(strXml);
    trace(strXml);
    stream.close();
    ]]>
    </mx:Script>
    <mx:SWFLoader height="93" width="708" id="mc_container_0" />
    <mx:SWFLoader height="393" width="708" id="mc_container_1" />
    <mx:SWFLoader height="293" width="708" id="mc_container_2" />
    </mx:WindowedApplication>
    =========================
    Somehow I need to get the XML data for the file location into each of the SWF loaders in Flex, but I simply don't know how to code it? It's probably very easy for an expert out there.
    Note: I only want to end up with an Air App which will be running locally on my machine.
    The idea is, when the XML file changes with new image data, the Air App will display that new image. The image will be added to the "myassets" folder too.
    If anyone out can point me in the right direction, it would certainly be appreciated.
    Many thanks.
    Tim

    Can anyone help me please?

  • ClasscastException while displaying image from content selector

    Hi,
    My requirement is show an image gif file in jsp, through portal.
    This problem is specific to 8.1 version.
    Created an image type content in BEA repository which i could retrieve from workshop
    content preview correctly, with a rule (named filerule).
    However, when tried to display the same from a simple jsp logic, got classcast
    exception.
    Below is the steps i have done.
    1. import <%@ page import="com.bea.p13n.content.ContentHelper"%>
    2.
    <pz:contentSelector rule="filerule" contentHome="<%=ContentHelper.DEF_DOCUMENT_MANAGER_HOME%>"
    id="ImageDocs"/>
    <es:forEachInArray array="<%=ImageDocs%>" id="anImageDoc" type="com.bea.p13n.content.Content">
    <img src="ShowDoc/<cm:printProperty
    id="anImageDoc" name="identifier" encode="url"/>"
    </es:forEachInArray>
    The server console shows below exception:
    java.lang.ClassCastException
    at jsp_servlet.__index6._jspService(index6.jsp:19)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
    (ServletStubImpl.java:971)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:402)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
    va:27)
    at com.bea.p13n.servlets.PortalServletFilter.doFilter(PortalServletFilte
    r.java:313)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
    va:27)
    at com.bea.wlw.netui.pageflow.PageFlowJspFilter.doFilter(PageFlowJspFilt
    er.java:208)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
    va:27)
    at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispat
    cherImpl.java:305)
    at com.bea.wlw.netui.pageflow.PageFlowRequestProcessor.superForward(Page
    FlowRequestProcessor.java:1304)
    at com.bea.wlw.netui.pageflow.PageFlowRequestProcessor$DefaultHttpRedire
    ctor.forward(PageFlowRequestProcessor.java:1320)
    at com.bea.wlw.netui.pageflow.PageFlowRequestProcessor.doForward(PageFlo
    wRequestProcessor.java:1200)
    at com.bea.wlw.netui.pageflow.PageFlowRequestProcessor.processForwardCon
    fig(PageFlowRequestProcessor.java:1094)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja
    va:279)
    at com.bea.wlw.netui.pageflow.PageFlowRequestProcessor.process(PageFlowR
    equestProcessor.java:651)
    at com.bea.wlw.netui.pageflow.AutoRegisterActionServlet.process(AutoRegi
    sterActionServlet.java:527)
    at com.bea.wlw.netui.pageflow.PageFlowActionServlet.process(PageFlowActi
    onServlet.java:152)
    at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
    (ServletStubImpl.java:971)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:402)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
    va:27)
    at com.bea.p13n.servlets.PortalServletFilter.doFilter(PortalServletFilte
    r.java:313)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
    va:27)
    at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispat
    cherImpl.java:305)
    at com.bea.wlw.netui.pageflow.PageFlowRequestProcessor.superForward(Page
    FlowRequestProcessor.java:1304)
    at com.bea.wlw.netui.pageflow.PageFlowRequestProcessor$DefaultHttpRedire
    ctor.forward(PageFlowRequestProcessor.java:1320)
    at com.bea.wlw.netui.pageflow.PageFlowRequestProcessor.doForward(PageFlo
    wRequestProcessor.java:1200)
    at com.bea.wlw.netui.pageflow.PageFlowRequestProcessor.process(PageFlowR
    equestProcessor.java:638)
    at com.bea.wlw.netui.pageflow.AutoRegisterActionServlet.process(AutoRegi
    sterActionServlet.java:527)
    at com.bea.wlw.netui.pageflow.PageFlowActionServlet.process(PageFlowActi
    onServlet.java:152)
    at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
    (ServletStubImpl.java:971)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:402)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
    va:27)
    at com.bea.p13n.servlets.PortalServletFilter.doFilter(PortalServletFilte
    r.java:313)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
    va:27)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
    n.run(WebAppServletContext.java:6356)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
    dSubject.java:317)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
    118)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
    rvletContext.java:3635)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
    pl.java:2585)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    >
    Also, there is no luck with displaying text content from a file, using printDoc
    tag. Can some one point me to right resource.

    Hi panji,
    I used 7.0 tag lib, just to make use of "printDoc" tag which is available in 7.0version
    only and not in 810. However, i figured out a way to display image using 8.1 (
    of course, by using request.getContextPath() + "/ShowBinary" + imagedoc.getPath())
    But still, i do not find a way to display a doc type file in jsp, which is my
    original problem.
    As per the edocs at http://edocs.bea.com/workshop/docs81/doc/en/core/index.html,
    <cm:getProperty node="<%=doc_node%>" name="file"/>
    should be able to display a txt file but nothing is getting rendred onto jsp.
    ( i have created a book type content in the repo. and file attached is of type
    txt ).
    Can you pls give some clue what i am missing here?
    thanks
    Ramana
    "Panji Aryaputra" <[email protected]> wrote:
    Hi Ramana, could you just use the ShowPropertyServlet to display the
    image
    in jsp? That's what I am using now. Perhaps you have other reasons not
    to
    use it?
    panji.a
    "ramana" <[email protected]> wrote in message
    news:[email protected]...
    Hi,
    My requirement is show an image gif file in jsp, through portal.
    This problem is specific to 8.1 version.
    Created an image type content in BEA repository which i could retrievefrom workshop
    content preview correctly, with a rule (named filerule).
    However, when tried to display the same from a simple jsp logic, gotclasscast
    exception.
    Below is the steps i have done.
    1. import <%@ page import="com.bea.p13n.content.ContentHelper"%>
    2.
    <pz:contentSelector rule="filerule"contentHome="<%=ContentHelper.DEF_DOCUMENT_MANAGER_HOME%>"
    id="ImageDocs"/>
    <es:forEachInArray array="<%=ImageDocs%>" id="anImageDoc"type="com.bea.p13n.content.Content">
    <img src="ShowDoc/<cm:printProperty
    id="anImageDoc" name="identifier" encode="url"/>"
    </es:forEachInArray>
    The server console shows below exception:
    java.lang.ClassCastException
    at jsp_servlet.__index6._jspService(index6.jsp:19)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
    atweblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
    (ServletStubImpl.java:971)
    atweblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:402)
    atweblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
    atweblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
    va:27)
    atcom.bea.p13n.servlets.PortalServletFilter.doFilter(PortalServletFilte
    r.java:313)
    atweblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
    va:27)
    atcom.bea.wlw.netui.pageflow.PageFlowJspFilter.doFilter(PageFlowJspFilt
    er.java:208)
    atweblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
    va:27)
    atweblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispat
    cherImpl.java:305)
    atcom.bea.wlw.netui.pageflow.PageFlowRequestProcessor.superForward(Page
    FlowRequestProcessor.java:1304)
    atcom.bea.wlw.netui.pageflow.PageFlowRequestProcessor$DefaultHttpRedire
    ctor.forward(PageFlowRequestProcessor.java:1320)
    atcom.bea.wlw.netui.pageflow.PageFlowRequestProcessor.doForward(PageFlo
    wRequestProcessor.java:1200)
    atcom.bea.wlw.netui.pageflow.PageFlowRequestProcessor.processForwardCon
    fig(PageFlowRequestProcessor.java:1094)
    atorg.apache.struts.action.RequestProcessor.process(RequestProcessor.ja
    va:279)
    atcom.bea.wlw.netui.pageflow.PageFlowRequestProcessor.process(PageFlowR
    equestProcessor.java:651)
    atcom.bea.wlw.netui.pageflow.AutoRegisterActionServlet.process(AutoRegi
    sterActionServlet.java:527)
    atcom.bea.wlw.netui.pageflow.PageFlowActionServlet.process(PageFlowActi
    onServlet.java:152)
    atorg.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    atweblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
    (ServletStubImpl.java:971)
    atweblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:402)
    atweblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
    atweblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
    va:27)
    atcom.bea.p13n.servlets.PortalServletFilter.doFilter(PortalServletFilte
    r.java:313)
    atweblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
    va:27)
    atweblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispat
    cherImpl.java:305)
    atcom.bea.wlw.netui.pageflow.PageFlowRequestProcessor.superForward(Page
    FlowRequestProcessor.java:1304)
    atcom.bea.wlw.netui.pageflow.PageFlowRequestProcessor$DefaultHttpRedire
    ctor.forward(PageFlowRequestProcessor.java:1320)
    atcom.bea.wlw.netui.pageflow.PageFlowRequestProcessor.doForward(PageFlo
    wRequestProcessor.java:1200)
    atcom.bea.wlw.netui.pageflow.PageFlowRequestProcessor.process(PageFlowR
    equestProcessor.java:638)
    atcom.bea.wlw.netui.pageflow.AutoRegisterActionServlet.process(AutoRegi
    sterActionServlet.java:527)
    atcom.bea.wlw.netui.pageflow.PageFlowActionServlet.process(PageFlowActi
    onServlet.java:152)
    atorg.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    atweblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
    (ServletStubImpl.java:971)
    atweblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:402)
    atweblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
    atweblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
    va:27)
    atcom.bea.p13n.servlets.PortalServletFilter.doFilter(PortalServletFilte
    r.java:313)
    atweblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
    va:27)
    atweblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
    n.run(WebAppServletContext.java:6356)
    atweblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
    dSubject.java:317)
    atweblogic.security.service.SecurityManager.runAs(SecurityManager.java:
    118)
    atweblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
    rvletContext.java:3635)
    atweblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
    pl.java:2585)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    >
    Also, there is no luck with displaying text content from a file, usingprintDoc
    tag. Can some one point me to right resource.

  • Displaying Image from ADF BC (BLOB Column) in ADF Mobile Application

    I have made an ADF BC over a database. Now I want to use that ADF BC's data control in my ADF Mobile App to display image stored in a blob column in the database!
    How should I got about it?
    Regards,
    Muhammad Zaheer

    Sir,
    I have exposed it through web services and I'm using the Web Service data control in my mobile application but the blob column is shown as output text in the data control. Now I don't know how to display the image from the blob column in my ADF mobile application.
    Looking forward for your help.
    Thank you.

  • Display image from database with jspSmart

    Hi
    I have successfully uploaded and saved images into oracle(8.1.5) table DATA_TYPE(dtid number, iconname varchar2(30), icon blob). When I try to display a specific icon in my browser, I get "javax.servlet.ServletException: General error" at:
    PreparedStatement pstmt = myConnection.prepareStatement(mySQL);
    My code looks like this:
    imgModifyDataType.jsp
    <%
    ResultSet myResultSet = null;
    Statement myStatement = null;
    Connection myConnection = null;
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
    myConnection = DriverManager.getConnection("Jdbc:Odbc:Te","te","te");
    String iconName;
    String pDTID = request.getParameter("dtid");
    String mySQL = "Select iconname, icon from data_types where dtid=?";
    PreparedStatement pstmt = myConnection.prepareStatement(mySQL);
    pstmt.setString(1,pDTID);
    myResultSet = pstmt.executeQuery();
    iconName = myResultSet.getString("iconname");
    myUpload.initialize(pageContext);
    myUpload.downloadField(myResultSet,"icon","application/x-msdownload", iconName);
    %>
    I call this JSP from another JSP like this:
    <img src="imgModifyDataType.jsp?dtid=<%=pDTID%>">
    If we cannt display image with the help of another jsp like this then please guide me how to modify the imgModifyDataType.jsp to a servlet because I have never worked in servlets.
    Please help
    Sajid

    I think that it may help you get image from database. I used two jsp page. First one is getphoto.jsp that makes as table based in sql statment and invoke the getimage.jsp this last returns images based on
    the getphoto.jsp PhotoId.
    /** getphoto.jsp source code */
    <%@page import="java.sql.*,oracle.jdbc.*"%>
    <html>
    <head>
    <title>
    jsp1
    </title>
    </head>
    <body bgcolor="#ffffff">
    <table width="781" border="2">
    <tr<<td>
    <td width="83" bgcolor="#C0C0C0"><b>PhotoId</b><td width="450" bgcolor="#C0C0C0"><b>Description</b></td><td width="228" bgcolor="#C0C0C0"><b>Photo Image</b></td>
    <%
    Connection conn = null;
    Statement stmt = null;
    ResultSet rset = null;
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    conn = DriverManager.getConnection("jdbc:oracle:thin:@itas:1521:oraITAS","yourDbUserId","yourDbPassword");
    stmt = conn.createStatement();
    rset = stmt.executeQuery("select photo_id,photo_description from photo");
    while (rset.next()) {
         %>
         <tr><td width="83"><%=rset.getObject("photo_id")%></td><td width="450"><%=rset.getObject("photo_description")%></td><td width="228"><img src="getimage.jsp?PhotoId=<%=rset.getObject("photo_id")%>" width="238" height="228"></td></tr>
         <%
    conn.close();
    %>
    </table>
    </body>
    </html>
    /** getimage.jsp source code */
    <%@ page contentType="image/jpeg; chaoResult=iso-8859-1" language="java" import="java.sql.*,java.io.*,java.util.*" errorPage="" %>
    <%
    String strConnString = null;
    Connection oDbConn;
    Statement oStmt;
    ResultSet oResult;
    String strConnection = null;
    String strUserId = "c_erober";
    String strUserPwd = "sybdev99";
    String strDatabase = "oraITAS";
    String strPhotoId;
    strConnString = "jdbc:odbc:" + strDatabase;
    String strSql;
    try {
    strPhotoId = (String) request.getParameter("PhotoId");
    strSql = "select photo_image from photo" + ( (strPhotoId==null) ? " where photo_id = '001'": (" where photo_id = '" + strPhotoId + "'") );
    DriverManager.registerDriver(new sun.jdbc.odbc.JdbcOdbcDriver());
    oDbConn = DriverManager.getConnection(strConnString,strUserId,strUserPwd);
    response.setContentType("image/jpeg");
    oStmt = oDbConn.createStatement();
    oResult = oStmt.executeQuery(strSql);
    oResult.next();
    byte[] bytearray = new byte[4096];
    int size=0;
    InputStream sImage;
    sImage = oResult.getBinaryStream(1);
    response.reset();
    response.setContentType("image/jpeg");
    response.addHeader("Content-Disposition","filename=getimage.jpeg");
    while((size=sImage.read(bytearray))!= -1 ) {
    response.getOutputStream().write(bytearray,0,size);
    response.flushBuffer();
    sImage.close();
    oDbConn.close();
    } catch (SQLException ex) { ex.getMessage();
    %>

Maybe you are looking for

  • JDBC Sender Adapter for AS/400 DB2 (V5R1) Error

    Hi, I'm trying to create a connection to an DB2 database on an AS/400 (V5R1) server. First does anyone know what JDBC driver I should use for this... I am trying to use the DB2 Universal type 4 JDBC driver... But have a suspicion I should be using th

  • Cardinality Problem?

    Hi all, I am using Model nodes for getting data and sending data back to BAPI. But if i perform search, i get results and once i come back and perform another search its showing previous results. I am invalidating Context and eventhen it shows previo

  • Please help me solve DM9601 USB NIC Adapter on Mac OS X 10.4, OS x 10.5

    Hello Apple users, I'm the System Administrator in a Government printing press and we are using eMacs and MacPro, there was this thunder storm and blown all the network ports and the management bought DM9601 USB NIc network adapters to be used before

  • Opening preview/quicktime etc opens all recently viewed items. how do i turn this feature off?

    since upgrading to Lion, I've noticed that when opening programs such as preview and quicktime it opens up a slew of recently viewed items. i can imagine how this could be a nice feature for one that is referencing said items, but i find it to be a n

  • Document repository in fsdb/dbfs mode

    Hi, Has anyone implemented the document repository in fsdb / dbfs mode? I am looking at possiility of storing documents in different server from where KM is installed. TREX needs to be able to search the documents as well. Please advise how the confi