View images in a datatable from byte[]

I am trying to view images in a datatable where the image is
a byte[]. This is what I tried... doesn't work.
<h:dataTable rows="5" value="#{AirportList.airportList}" var="airport" binding="#{AirportList.airportData}">
          <h:column>
            <f:facet name="header">
              <h:outputText value="airportCode"/>
            </f:facet>
            <h:outputText value="#{airport.airportCode}"/>
          </h:column>
          <h:column>
            <f:facet name="header">
              <h:outputText value="airportMap"/>
            </f:facet>
              <h:inputHidden id="ole" value="#{airport.airportMap}"/>
              <h:outputText value="#{AirportList.myMap}"/>
             <div>
             <!--
                  try
                    byte[] pic = (byte[])request.getAttribute("AirportList.myMap");
                    response.setContentType("image/jpeg");
                    OutputStream os = null;
                    os = response.getOutputStream() ;
                   // os.write(pic);
                    os.close();
                    os = null;
                  catch (Exception ex)
                    out.println("Exception: " + ex.getMessage());
                    ex.printStackTrace();
               -->
              </div>
          </h:column>
          <h:column>
            <f:facet name="header">
              <h:outputText value="airportSugBook"/>
            </f:facet>
            <h:outputText value="#{airport.airportSugBook}"/>
          </h:column>
        </h:dataTable>

my backing code
public class Airport
  Collection AirportList;
  private UIData AirportData;
  byte[] MyMap;
  public Airport()
  public Collection getAirportList()
    try{
      InitialContext context = new InitialContext();
      AirportLOBLocalHome home =  (AirportLOBLocalHome)context.lookup("java:comp/env/ejb/local/AirportLOBLocal");
      AirportLOBLocal local = home.create();
      AirportList = local.showAirports();
      Iterator it = AirportList.iterator();
      while(it.hasNext())
        ((OtnAirportLobDetailsLocalDTO)it.next()).getAirportMap();
      return AirportList;
    catch(Throwable e)
      e.printStackTrace();
    return null;
  public void setAirportList(Collection AirportList)
    this.AirportList = AirportList;
  public UIData getAirportData()
    return AirportData;
  public void setAirportData(UIData AirportData)
    this.AirportData = AirportData;
  public byte[] getMyMap()
    OtnAirportLobDetailsLocalDTO ap = (OtnAirportLobDetailsLocalDTO)AirportData.getRowData();
    return ap.getAirportMap();
   // return null;
  public void setMyMap(byte[] MyMap)
    this.MyMap = MyMap;
}

Similar Messages

  • View image instantly on monitor from camera with USB connection

    Hello,
    What I want is to see my image instantly on monitor when I am taking a picture from example a portrait or a painting in the studio. The camera is connected with USB to the computer.
    Help!!

    So I was shooting teathered the other day with the following:
    Nikon D100
    USB to Powerbook G4, 1.25 Ghz 2GB Ram OS 10.4.8
    Nikon Capture to Hot Folder
    Hot Folder to Aperture
    My issue was that sometimes for reasons I could not work out my
    Camera would lock-up after a couple of frames shot. I was also syncing
    to a couple of dynalites but I dont think it was a light re-cycle thing.
    This became embarrasing as my subject was standing there and my shutter
    would be locked up.
    Was this an issue with maxing out the processor on the Pbook?
    Or perhaps writing the file to aperture?
    Would it be better to have the image display in Nikon Capture and worry bout importing into Aperture later?
    After finally de-teathering and shooting normaly I never ran into the problem again.
    Any thoughts appreciated.
    TIA.
    G5 Dual Core, AL 15" Pbook, G4 Quicksilvr, G3 Wallsteet, PM 9600, Mac SE   Mac OS X (10.4.8)   iPods: Nano, 4th-Gen & 1st-Gen 5Gb Original Goodness!

  • I want to make a slideshow to view on my television with image's duration ranging from seconds to an hour or more and I want to use my iPhone or iPad mini to control the television through my Apple tv.  I've been unable to locate an app that will do this.

    I want to make a slideshow to view on my television with image's duration ranging from seconds to an hour or more and I want to use my iPhone or iPad mini to control the television through my Apple tv.
    I've been unable to locate an app that will do this.  The Photos app that comes with the phone or iPad has extremely limited duration controls.  PhotoStream seems to load everything from my phone or iPad not allowing me to just load up a set group of images.
    iPhoto for iPad is getting some terrible recent reviews.  I tried a couple other free apps but they don't use Airplay.
    I can do something like this with iPhoto and my MB Air, but it's kind of ugly to have the computer open in order to connect by Airplay to my Apple TV.  I've thought the iPad or iPhone would be a lower profile controller.
    Am I out of luck?

    Thanks for your help.  Since I'm uninterested in loading all my photos (the only option) into photostream, I won't be able to use the settings in ATV.  I guess I'm just stuck with using iPhoto on my MB Air.  Thanks again.
    paul

  • How to view images from application's path?

    Hello,
    I am using the codes below to view images from an ACCESS database listed as ".\image.png", the images are included in the application's path. I'm able to view the images while running crystal reports alone; However when I include the same report and databse in my VB.NET application, the images don't show. I was told that the report looks for the images in a temp folder, an alternative solution would be to copy the image files to a temp folder before attempting to run the report, but so many things can go wrong with such approach. Do you have a better solution to this problem?
    Thanks in advance.
    Victor
    Code:
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim myaop6viewer As New aop6viewer
            Dim myaop6report As New AOP6V2
            Dim crConnectionInfo As ConnectionInfo = New ConnectionInfo
            crConnectionInfo.ServerName = (Application.StartupPath & "\AOP6V2.mdb")
            crConnectionInfo.Password = "testaop"
            setDBLogonForReport(crConnectionInfo, myaop6report)
            myaop6report.RecordSelectionFormula = "isnull({image.country}) = false"
            With myaop6viewer
                .CrystalViewer22.ReportSource = myaop6report
                .Show()
            End With
            myaop6report = Nothing
        End Sub
        Private Sub setDBLogonForReport(ByVal connection As ConnectionInfo, ByVal report As ReportDocument)
            Dim mytables As Tables = report.Database.Tables
            Dim mytable As CrystalDecisions.CrystalReports.Engine.Table
            For Each mytable In mytables
                Dim mytablelogoninfo As TableLogOnInfo = mytable.LogOnInfo
                mytablelogoninfo.ConnectionInfo = connection
                mytable.ApplyLogOnInfo(mytablelogoninfo)
            Next
        End Sub

    I tried following your suggestions, but I'm unable to link to the image file from the application, can you please help me link to the image from the application.
    1. Created a formula name test with the folowing data:
    ".\test.png"
    2. In the Gphics Location, entered:
    {@test}
    3. Below is the code in my application
    Imports System.Data.OleDb
    Imports Microsoft.VisualBasic.ControlChars
    Imports CrystalDecisions.Shared
    Imports CrystalDecisions.CrystalReports.Engine
    Public Class Form1
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim myaop6viewer As New aop6viewer
            Dim myaop6report As New AOP6V2
            Dim crConnectionInfo As ConnectionInfo = New ConnectionInfo
            crConnectionInfo.ServerName = (Application.StartupPath & "\AOP6V2.mdb")
            crConnectionInfo.Password = "testaop"
            setDBLogonForReport(crConnectionInfo, myaop6report)
            myaop6report.DataDefinition.FormulaFields.Item("@test").Text = "path + picture name" '???????
            myaop6report.RecordSelectionFormula = "isnull({image.country}) = false"
            With myaop6viewer
                .CrystalViewer22.ReportSource = myaop6report
                .Show()
            End With
            myaop6report = Nothing
        End Sub
        Private Sub setDBLogonForReport(ByVal connection As ConnectionInfo, ByVal report As ReportDocument)
            Dim mytables As Tables = report.Database.Tables
            Dim mytable As CrystalDecisions.CrystalReports.Engine.Table
            For Each mytable In mytables
                Dim mytablelogoninfo As TableLogOnInfo = mytable.LogOnInfo
                mytablelogoninfo.ConnectionInfo = connection
                mytable.ApplyLogOnInfo(mytablelogoninfo)
            Next
        End Sub
    Thanks,
    Victor

  • How to view images from Pictures Folder using iPhoto?

    Right now when I click an image in the Pictures folder, the image is automatically opened using Preview. I want to view images directly from my Pictures folder, and have them open to iPhoto. Is that possible?
    I just want to be able to view/sort my photos by Folders rather than by Events, Titles or Photo dates. I can't seem to get them to sort by folders in iPhoto.

    Iphoto is a Photo Database designed to allow you to organise and manipulate you photos without recourse to your files.
    It's not an image viewer, it can only work with photos that have been imported to the database.
    I just want to be able to view/sort my photos by Folders rather than by Events,
    An Event is a folder of images with a fancy icon. You can organize your pics in iPhoto anyway you want, using Albums, folders, keywords and so on. It's far more flexible that using folders in the Finder.
    You can opt to organise the files yourself, rather than have iPhoto do it for you, but I don't recommend it.
    Simply go to iPhoto Menu -> Preferences -> Advanced and uncheck 'Copy Files to the iPhoto Library on Import'.
    Now iPhoto will not copy the files, but rather simply reference them on your HD. To do this it will create an alias in the Originals Folder that points to your file. It will still create a thumbnail and, if you modify the pics, a Modified version within the iPhoto Library Folder.
    However, you need to be aware of a number of potential pitfalls using this system.
    1. Import and deleting pics are more complex procedures
    2. You cannot move or rename the files on your system or iPhoto will lose track of them on systems prior to 10.5 and iPhoto 08. Even with the later versions issues can still arise if you move the referenced files to new volumes or between volumes.
    3. Most importantly, migrating to a new disk or computer can be much more complex.
    Always allowing for personal preference, I've yet to see a good reason to run iPhoto in referenced mode unless you're using two photo organisers.
    If disk space is an issue, you can run an entire iPhoto Library from an external disk:
    1. Quit iPhoto
    2. Copy the iPhoto Library as an entity from your Pictures Folder to the External Disk.
    3. Hold down the option (or alt) key while launching iPhoto. From the resulting menu select 'Choose Library' and navigate to the new location. From that point on this will be the default location of your library.
    4. Test the library and when you're sure all is well, trash the one on your internal HD to free up space.
    If you're concerned about accessing the files, There are many, many ways to access your files in iPhoto:
    *For Users of 10.5 and later*
    You can use any Open / Attach / Browse dialogue. On the left there's a Media heading, your pics can be accessed there. Command-Click for selecting multiple pics.
    Uploaded with plasq's Skitch!
    You can access the Library from the New Message Window in Mail:
    Uploaded with plasq's Skitch!
    *For users of 10.4 and later* ...
    Many internet sites such as Flickr and SmugMug have plug-ins for accessing the iPhoto Library. If the site you want to use doesn’t then some, one or any of these will also work:
    To upload to a site that does not have an iPhoto Export Plug-in the recommended way is to Select the Pic in the iPhoto Window and go File -> Export and export the pic to the desktop, then upload from there. After the upload you can trash the pic on the desktop. It's only a copy and your original is safe in iPhoto.
    This is also true for emailing with Web-based services. However, if you're using Gmail you can use iPhoto2GMail
    If you use Apple's Mail, Entourage, AOL or Eudora you can email from within iPhoto.
    If you use a Cocoa-based Browser such as Safari, you can drag the pics from the iPhoto Window to the Attach window in the browser.
    *If you want to access the files with iPhoto not running*:
    For users of 10.6 and later:
    You can download a free Services component from MacOSXAutomation which will give you access to the iPhoto Library from your Services Menu. Using the Services Preference Pane you can even create a keyboard shortcut for it.
    For Users of 10.4 and later:
    Create a Media Browser using Automator (takes about 10 seconds) or use this free utility Karelia iMedia Browser
    Other options include:
    1. *Drag and Drop*: Drag a photo from the iPhoto Window to the desktop, there iPhoto will make a full-sized copy of the pic.
    2. *File -> Export*: Select the files in the iPhoto Window and go File -> Export. The dialogue will give you various options, including altering the format, naming the files and changing the size. Again, producing a copy.
    3. *Show File*: Right- (or Control-) Click on a pic and in the resulting dialogue choose 'Show File'. A Finder window will pop open with the file already selected.
    You can set Photoshop (or any image editor) as an external editor in iPhoto. (Preferences -> General -> Edit Photo: Choose from the Drop Down Menu.) This way, when you double click a pic to edit in iPhoto it will open automatically in Photoshop or your Image Editor, and when you save it it's sent back to iPhoto automatically. This is the only way that edits made in another application will be displayed in iPhoto.
    Regards
    TD

  • Displaying Image from byte[ ]

    I am using Webservice for data control and ADF UI (Jdev 11.1.1.3)
    I need to display image on jsff using the byte[] I receive from web service which fetches data from BLOB column in DB. Is there any way apart from ImageServlet because I am not allowed to access DB.
    Thanks in advance. Amit

    ImageServlet doesn't mean that you need to access data from DB. af:image needs a source, so ImageServlet acts as source for this, the implementation of data retrieval can be modified as per your use case.

  • How to view Images from Filesystem in Apex?

    hello,
    i want to view images from a network share (e.g. \\10.67.125.22\CREATIVES_DE\PRINT\THUMB\2009\06\002259044s01.JPG don´t nedd http access because it´s only intranet) in an image column of a table. unfortunatly i can´t upload them all into apex because i have really much data. i´m talking about serveral terabytes. i also want to link to videos on a network share but apex always inserts "http://ham-v000002:8080/apex/" in front of the link from the database...
    can someone help me out?
    greetings
    Sebastian

    i´m getting closer...
    apex stopped inserting the localhost-string as i put "file://" in the "src" attribute. But now i´m dealing with odd slash-adding from apex.
    the value located in the #THUMB# variable is like this:
    \\10.67.125.22\CREATIVES_DE\PRINT\THUMB\2009\06\002268162s01.JPG
    and here´s what apex returns on "<img src="file://#THUMB#">":
    file:////10.67.125.22/CREATIVES_DE/PRINT/THUMB/2009/06/002268162s01.JPG
    and the same with three slashes "<img src="file://#THUMB#">"
    file://///10.67.125.22/CREATIVES_DE/PRINT/THUMB/2009/06/002268162s01.JPG
    if i just do "<img src="file:#THUMB#">" (which should return the correct path), oralce cuts away the ip-adress:
    file:///CREATIVES_DE/PRINT/THUMB/2009/06/002268162s01.JPG
    i don´t know what´s wrong here...
    greetings,
    Sebastian

  • I cannot view images imported from nikon d4

    i cannot view images imported from nikon d4.
    I have just upgraded to the most current version of aperture and when I import images from my qxd card it looks like it is importing but no images show up.

    So the images show up in the Import pane of Aperture but after you press the Import button they do not show in the project you are importing into?
    Does this happen for both Raw and JPG images?

  • HT4106 Will the camera kit allow you to view images from a usb flash drive?

    Will the camera kit allow you to view images from a usb flash drive?

    You can use a USB flash drive & the camera connection kit.
    Plug the USB flash drive (works the same with an SD card) into your computer & create a new folder titled DCIM. Then put your movie/photo files into the folder. The files must have a filename with exactly 8 characters long (no spaces) plus the file extension (i.e., my-movie.mov; DSCN0164.jpg).
    Now plug the flash drive into the iPad using the camera connection kit. Open the Photos app, the movie/photo files should appear & you can import. (You can not export using the camera connection kit.)
    Using The iPad Camera Connection Kit
    http://support.apple.com/kb/HT4101
     Cheers, Tom

  • View image from local

    Hi,
    I'm using J2ME wireless toolkit, and I want to know is it possible to view image from local(eg. C:\WTK22\appdb\DefaultColorPhone\filesystem\root1). I've written some code to view form the folder but it appear "error: null".
    mage storedImage = null;
              String picLink = "file://localhost/" + currDirName + fileName;
              try{
                   storedImage = Image.createImage(picLocation);
              catch(Exception e){
                   System.out.println("Error here: " + e.getMessage());
              }

    Yes, it is possible.
    They were demonstrating the RT display at NI Week. It is part of the RT features of Vision 6.1. You can route an IMAQ display window to the video output on the PXI chassis. Anything you display in that window will show up on your screen.
    Bruce
    Bruce Ammons
    Ammons Engineering

  • How to insert and view images from oracle using jsf

    Can anyone please give me some code example or link of article explaining that how can i insert and view images to/from oracle using jsf?
    Thanks in advance.

    You mean you want to view image data stored in the database, right?
    Create a servlet that streams the image data to the response (setting the appropriate content-type), then reference this servlet in your img tag. Here is an example:
    http://balusc.blogspot.com/2007/04/imageservlet.html
    Storage is something different. What exactly don't you understand there? Perhaps you want a file upload component?

  • Firefox saves images to wrong location, but only when using "View Image"

    For a while, I have had the problem above. I can save images just fine if I don't use the "view image" function first, with the images going to the intended folders.
    Just to clarify, unlike some of similar problems I have seen described here, I am perfectly happy with Firefox remembering where I wish my pictures to go, on a site to site, or model to model (within the same site) basis.
    The problem lies in that if I use the "view image" function, either in a new tab, or in the existing one, Firefox will often prompt me to save in a random folder where I have previously saved a picture. It will even suggest folders that I have not accessed for days.
    Example:
    I save image A to folder A, by right clicking the image and selecting "save image as".
    I then (immediately after this), right click image A again, select "view image", then right click the resulting picture, and select "save image as". Now there is a fine chance that it want me to save the image to some other (previously used) image folder, even if I have not used the folder for a while, and even though I have just saved the same image to folder A.
    This problem persists with multiple image file types, on multiple sites (I just tried it with someones avatar in this forum, and it wanted me to put it with my holiday pictures from 3 weeks ago).
    I appreciate any assistance you can give - jinxie
    FYI; If I "one-click" a file (like an mp4) to download it, it goes to my main / default download folder as normal.

    This is because Firefox will track where you have saved images or other files from the website domain. Then whenever you select to save the file to your computer, Firefox will start the Save As wizard in the latest folder that you have used last time.
    Here is an example:<br>
    If you save an image from the domain <code>123.com</code> into the folder <code>123</code> it will save there. Then you save an image from the domain <code>456.com</code> to the folder <code>456</code>. Next you save a different image from the domain <code>123.com</code>. The save as wizard will assume that you want to save it with the other image from that domain and will automatically start in the <code>123</code> folder.<br>
    This can make saving files faster and more organized, however not everyone wants this feature enabled.
    To disable this feature you can do the following:
    #Go to <code>about:config</code> in Firefox
    #Locate the <code>browser.download.lastDir.savePerSite</code> string
    #Change the value to <code>false</code>
    This should fix the issue, but please report back if it doesn't.

  • What do I do to view images on CS5-64 when it will not open them?

    The program will not open images, either directly or from Bridge.  Using Win 7 on a Dell PC.

    Strange, after rebooting, both Ph CS5 and Bridge are working again.  Thanks for getting with me.
    Date: Fri, 9 Aug 2013 23:30:38 -0700
    From: [email protected]
    To: [email protected]
    Subject: What do I do to view images on CS5-64 when it will not open them?
        Re: What do I do to view images on CS5-64 when it will not open them?
        created by Mylenium in Photoshop for Beginners - View the full discussion
    What exactly? What image files? Do you get any error messages/ warnings? Provide more info.
    Mylenium
         Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/5582783#5582783
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/5582783#5582783
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/5582783#5582783. In the Actions box on the right, click the Stop Email Notifications link.
         Start a new discussion in Photoshop for Beginners by email or at Adobe Community
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • Is there a way to view image numbers in iPad photos, either of images taken with the iPad or of images copied into Photo (or camera roll) on the iPad?

    Is there a way to view image numbers (metadata) on the iPad Photo app, distinguishing those taken with the internal camera from those downloaded from external camera or copied from an email?

    sberman: My iMac is running iTunes 11.0.2 already. As well, the Photos tab in the iTunes window shows that "Sync Photos from" is un-checked. And in the box to the right of it is the greyed-out empty folder that I previously synced to in order to remove photos from the Camera Roll.
    Ralph9430: I did a reset (Home + Sleep) earlier when I was trying everything I could think of. I have also re-synced a couple of times. No luck.
    Thanks anyway. I was hoping someone out there would tell me they've experienced the same problems (non-functioning DELETE button, and persistent data in Photo Library), even if they haven't found a solution. Then I could assume it's a iOS 6 bug. All I can think of to do next is a full iPad restore.

  • How to show an image in JSP given the bytes[] of the photo?

    Hi all,
    I stored a user's picture in the db as text. For this I simply converted the JPG to bytes[] and from bytes to string: Base64.encode(bytes)
    Now I wish to do the reverse - to 'output' the image on the screen. So given the bytes[] of the image with
              byte[] bytesDB = Base64.decode(userPhotoStr); //userPhotoStr is something like this: /9j/4AAQSkZJRgA...Question: How can I show the image in the JSP page embedded in the page not as download?
    I'm using struts with JSP pages.
    Thank you!!!!

    Images in HTML are to be displayed using <img> element. All what an <img> element can take as image is an URL pointing to the image in question.
    If the image is dynamic, then you can just let that URL point to some Servlet which takes some request parameter or reads the path info, reads/gets the image as byte array or (much more efficient) as inputstream and writes it to the outputstream of the response.
    You may get some ideas out of this: [http://balusc.blogspot.com/2007/04/imageservlet.html].
    By the way, massaging the byte array from/to a String is a terribly bad idea. Just store bytes as computer readable bytes, not as human readable characters, this makes completely no sense. Characters on its turn have to be converted to bytes again after all, but now you've let the DB do the work. All with all a performance pain. Bytes > Chars > Bytes > Chars > Bytes instead of just Byes > Bytes. In database you normally use BLOB, BINARY or equivalent for this in combination with JDBC's PreparedStatement#setBinaryStream() and ResultSet#getBinaryStream().

Maybe you are looking for