Display Images dynamically on a servlet

I saw postings earlier on this topic and adopted the suggestions given , but I can display only a single image.This works for a single image jpg .All the files uploaded are
into c:\temp. The Servlet program parses through the dir and picks up
only jpg's (since I want to display all jpg's first and then expand to
gif's).The servlet now displays only an icon but no images .
I initially brought all the images in to a ArrayList but I thought its
better to display directly from the filesystem.
Please let me know what is the problem
import java.io.*;
import java.util.*;
import java.lang.*;
import javax.servlet.http.*;
import javax.servlet.*;
import java.awt.*;
import java.awt.geom.*;
import java.awt.image.*;
import javax.swing.*;
import com.sun.image.codec.jpeg.JPEGCodec;
import com.sun.image.codec.jpeg.JPEGImageEncoder;
import com.sun.image.codec.jpeg.* ;
* @author
public class DisplayImage extends HttpServlet
java.util.List aList = new ArrayList();
public void service(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException
String path= "c:\\temp\\";
File f = new File(path);
String[] dirList = f.list();
int l=100;
int k=100;
response.setContentType("image/jpeg");
OutputStream out = response.getOutputStream();
PrintWriter out = response.getWriter();
for( int i = 0; i < dirList.length; ++i )
String fExt= "jpg";
// System.out.println(">>The files in the dir are>>:"+dirList[i] );
String filename = dirList.toString();
// System.out.println("FileName is"+filename);
int sLength = filename.length();
int sLastIndex = filename.lastIndexOf(".",sLength);
//System.out.println(">>Last Index Value>>"+sLastIndex);
String imageExt = filename.substring(sLastIndex+1,sLength);
//System.out.println(">>ImageExtensionis>>"+imageExt);
if(imageExt.equalsIgnoreCase(fExt))
String imagefilename = path+filename;
//System.out.println(">>Final filename is>> "+imagefilename);
Image myImage = new ImageIcon(imagefilename).getImage();
BufferedImage outImage = new BufferedImage(10,10 ,BufferedImage.TYPE_INT_RGB);
Graphics2D d2g = outImage.createGraphics();
d2g.drawImage(myImage, l, k, null);
//AffineTransformOp afo = new AffineTransformOp(af,1);
//BufferedImageFilter bf = new BufferedImageFilter(afo);
//d2g.drawImage(myImage, null, l,k);
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
encoder.encode(outImage);
k+=100;
else
System.out.println(">>Not a jpeg file>>");
out.close();

Thanks for the reply.
What I intend to do is :
1.Displa.jsp calls a servlet DisplayImage
2.DisplayImage goes to a known directory in the filesystem and picks up all images.
3.Display all the images on the servlet at once in thumbnail fashion.
4.Click on each image to enlarge it.
So far I am stuck at step 3.
So how do I proceed about on this problem , do I need to open and close the request in the for loop each time?

Similar Messages

  • Display Images Dynamically

    Hai
    I am new to Jdeveloper. I have a task to display images dynamically.
    <img src="file:///Z:/Image/sample.bmp "
    alt="images" />
    i am using mysql database.i am getting the path from database.
    Now i want to pass the path of the image file.how can i do it
    If anybody knows please tell me
    thanks
    raju

    Hi,
    Assuming that your technology is ADF/JSF .... you only need to create a binding for the image source attribute and then use an af:objectImage tag to display the image. You could use for example something like this :
    <af:objectImage source="#{bindings.ImageSource.inputValue}"/>Just remember that in order for the image to display correctly, the path from the database has to be relative to your web root.
    Thanassis

  • Proble displaying images dynamically in jsp

    Hi, I am new here. I have to display the images dynamically reading from a database. I have no problem displaying images. When i try to reduce the width in img tag then it is slowly rendering it. How to overcome this.
    <img src="image.jsp?imgID=112" width="150" heigth="130" border="0">
    I am also giving the sample jsp to display
         byte [] imgData = blob.getBytes(1,(int)blob.length());
    response.setContentType("image/jpeg");
    OutputStream o = response.getOutputStream();
    o.write(imgData);
    I want to display the image without any time taken. How could I solve this. Please Help me.
    Thanks.
    Phani.

    You should not crosspost questions. It is rude and a waste of our time.
    Please stick to one topic: [http://forums.sun.com/thread.jspa?threadID=5372144].

  • Displaying image dynamically

    Hi,
    i am getting data from backend sys its working fine.
    when eve we r give input like material number like 1, 2, ....... then then press button it shows data and IMAGE also
    here i have taken images 1.jpg, 2.jpg, .......... workspace -
    > mimes-----> comp.............
    i am setting source of that image prop like 1.jpg here
    when i give input   1   and click button it display r/3data and image but it is used for that only. if i want to display 2  then i change image prop source (here material number is 1 and image is 1.jpg.........depends up on material num can we write code here)
    i want to display it dynamically (depends upon material num it can show the data and image)
    can any one help
    Regards
    bhanu

    Hi Nikhil,
    i am explaining about my thread clearly
    i have taken 1.jpg, 2.jpg, 3.jpg....... images in workspace ..mimes ... components ... packageee
    now take button and image with  visible prop
    In  init() method i have take instance,bind for backend data
    setting visible prop none(image)
    In onaction()
    have taken execute,invalidate in try catch
    setting visible prop is visible(image)
    when i give material no  1  then it can display output  data and image
    if i want to display material no 2 data
    when i give  material no 2 then it can display output data  but image is 1.jpg  b'coz  i set source of image porp as 1.jpg
    the above posted code i have taken in onaction button().
    through hard coding i can display it individually but i want to display it dynamically  likee
    when we give material no 1 it can display 1's data and image 
    when we give material no 2 it must  display 2's data and image
    can u explain me clearly if possible with step by step.
    sorry for the late reply
    Regards,
    bhanu.

  • Display images like in images search engines

    I have a list of images that I want to display like the results in yahoo image and google image search engines.But when i use tha datatable component I can just display one column.And after I want to do something after that the user clicks on an image for example displaying it with real size not in thumbnail mode.
    I also tryed using the image browse widget and the yahoo carousel but I dont know how to hand events and how to know which picture is selected.
    Can you please help me.
    Thanks in advance

    fiedlerm wrote:
    I try to display workspace Image in a HTML Region dynamically.
    The Image Source is stored in a hidden Item filled by an application process.
    Region - Source:Always post code using <tt>\...\</tt> tags.
    <img src="#WORKSPACE_IMAGES#Sunny.gif">
    <br></br>
    &P1_ICON_SRC.
    <br></br>The first "hardcoded" Image was displayed.
    The second "dynamic" Image shows the following Text in the HTML - Region:
    <img src="wwv_flow_file_mgr.get_file?p_security_group_id=7856557026011968186&p_fname=Blizzard.gif"> Hidden page items cannot contain HTML mark-up. Look at the page source. When the item is rendered its value is contained in the hidden <tt>input</tt> element's <tt>value</tt> attribute:
    <input type="hidden" name="p_t01" id="P1_ICON_SRC" value="&lt;img src=&quot;wwv_flow_file_mgr.get_file?p_security_group_id=7856557026011968186&amp;p_fname=Blizzard.gif&quot;&gt;">The value must be properly HTML-escaped like this otherwise the browser would see it as tag soup:
    <input type="hidden" name="p_t01" id="P1_ICON_SRC" value="<img src="wwv_flow_file_mgr.get_file?p_security_group_id=7856557026011968186&p_fname=Blizzard.gif">">What exactly are you trying to achieve?
    Options for displaying images dynamically would include putting the required mark-up in an HTML region, only storing the image URI (or parts of it) in the page item, and referencing this using static text substitution. Others would be custom report templates or Dynamic PL/SQL regions.
    If you must store HTML code in session state and access it using static text substitution (not recommended) then use an application item.
    h4. Page Process
    begin
      :P1_ICON_SRC := 'Blizzard.gif'; -- Hidden page item
      :F41327_ICON_SRC2 := '<img src="#WORKSPACE_IMAGES#Blizzard.gif">'; -- Application item;
    end;h4. HTML region source
    <img src="#WORKSPACE_IMAGES#Sunny.gif">
    <br></br>
    <img src="&WORKSPACE_IMAGES.&P1_ICON_SRC.">
    <br></br>
    &F41327_ICON_SRC2.

  • Displaying a dynamic image in a jsp

    I am interested in the way of dynamically generating an image in a web browser. The image should be formed on the servlet, more precisely with the aid of a servlet, and reloaded in the web browser every time it suffers modifications (for example, elements are drawn). The drawing and displaying part is already functioning not as a server application, but as a desktop one. The result of the drawing actions are displayed in a Bufferd Image view. What I have to do is to display this image in the browser, encoded as a gif (I already know how to do the encoding part).
    //code from TheServlet.java
    ImageViewPort view = new ImageViewPort(600, 600); // BufferedImage type
    Image image = view;
    g = image.getGraphics();
    response.setContentType("image/gif");
    GifEncoder encoder = new GifEncoder(image, out);
    encoder.encode();
    How would I correctly reference in the HTML form this servlet? In the HTML form I have to display the dynamically created GIF image as a server side image map?
    // code from the HTML form
    <img WIDTH=600 HEIGHT=600 BORDER="2" src="http://localhost:8080/servlet/TheServlet");
    ISMAP/>
    How should be written the source of these image map?

    you can use AJAX for this.. google maps is using ajax for rendering their maps..

  • Dynamic display image

    hi, everyone. i have a question on displaying image. for displaying image from a folder, i use:
    <IMG src="/image/me.jpeg" >
    But i can only display one image at one times. Is there ways to display images from folder dynamically?? Thank in advance.

    if u are new to java.. then u may have to go thru some tutorials on servlets to get ur required job done. here are a list of online tutorials
    http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/Servlets.html
    http://www.novocode.com/doc/servlet-essentials/
    http://www.acknowledge.co.uk/java/tutorial/servlet_tutorial/
    hope these will be useful for u.. u may have to spend some time on these...

  • How to display a dynamic image file from url?

    Hey,I want to display a dynamic image file from url in applet.For example,a jpg file which from one video camera server,store one frame pictur for ever.My java file looks like here:
    //PlayJpg.java:
    import java.awt.*;
    import java.applet.*;
    import java.net.*;
    public class PlayJpg extends Applet implements Runnable {
    public static void main(String args[]) {
    Frame F=new Frame("My Applet/Application Window");
    F.setSize(480, 240);
    PlayJpg A = new PlayJpg();
    F.add(A);
    A.start(); // Web browser calls start() automatically
    // A.init(); - we skip calling it this time
    // because it contains only Applet specific tasks.
    F.setVisible(true);
    Thread count = null;
    String urlStr = null;
    int sleepTime = 0;
    Image image = null;
    // called only for an applet - unless called explicitely by an appliaction
    public void init() {
                   sleepTime = Integer.parseInt(getParameter("refreshTime"));
              urlStr = getParameter("jpgFile");
    // called only for an applet - unless called explicitely by an appliaction
    public void start() {
    count=(new Thread(this));
    count.start();
    // called only for applet when the browser leaves the web page
    public void stop() {
    count=null;
    public void paint(Graphics g) {
    try{
    URL location=new URL(urlStr);
    image = getToolkit().getImage(location);
    }catch (MalformedURLException mue) {
                   showStatus (mue.toString());
              }catch(Exception e){
              System.out.println("Sorry. System Caught Exception in paint().");
              System.out.println("e.getMessage():" + e.getMessage());
              System.out.println("e.toString():" + e.toString());
              System.out.println("e.printStackTrace():" );
              e.printStackTrace();
    if (image!=null) g.drawImage(image,1,1,320,240,this);
    // called each time the display needs to be repainted
    public void run() {
    while (count==Thread.currentThread()) {
    try {
    Thread.currentThread().sleep(sleepTime*1000);
    } catch(Exception e) {}
    repaint(); // forces update of the screen
    // end of PlayJpg.java
    My Html file looks like here:
    <html>
    <applet code="PlayJpg.class" width=320 height=240>
    <param name=jpgFile value="http://Localhost/playjpg/snapshot0.jpg">
    <param name=refreshTime value="1">
    </applet>
    </html>
    I only get the first frame picture for ever by my html.But the jpg file is dynamic.
    Why?
    Can you help me?
    Thanks.
    Joe

    Hi,
    Add this line inside your run() method, right before your call to repaint():
    if (image != null) {image.flush();}Hope this helps,
    Kurt.

  • Not able to display a dynamic image

    I'm not able to display a dynamic image on Adobe print form.
    Here is what I did.
    Please let me know what I need to do to get this working...
    1. Created a Graphics node in the Context of the Adobe form.
    2. In the URL tab of the graphics node defined the following two lines:
         <URL pointing to the MIME repository folder>
         IM_FILENAME_1
         Where IM_FILENAME_1 is being passed to the Adobeform function module.
    3. In the Layout mode, dragged and dropped the Graphics node from the
        contenxt tab to the form layout. On doing so it appears as a image field in the form layout.
    4. Activated the form.
    BUT, when I run the form , the image is not showing up.
    The idea is to pass the image file name to the form so that it will show up a dynamic image at run time.
    PLEASE HELP.

    Hi Atul,
    Try this, that should work.
    In the interface , define a parameter type string where you will store the URL of the image .
    In the initialization part of the interface , check if the URL is defined, in case it's empty define a default URL . You should put the compelte URL of the image like "http://www.company.org:8080/logo.logo.jpg" .
    Then link this parameter to the Grpahic Node in the URL parameters .
    Let me know if that works

  • Displaying a dynamic image using a PDF file.

    I am trying to find a way to display an image dynamically in my report.  The image happens to be .pdf  I have Crystal Reports  XI and I have the graphic location formula completed "
    10.93.138.250\Production\ProdOut\00\" & {Order_Record.URN_text} + "_p1.pdf" however it tells me PDF is not supported.  Is there a way around this?

    I have to agreed that what you are saying appears to be true from my attempts at getting .pdf files to work dynamically.  Using .bmp and .jpg files seems to work just fine but not .pdf, .xls, or .doc.
    In the Users Guide, in chapter 16, in the section titled "Working with static OLE objects" - it only talks about the picture type formats you mentioned and metafiles.  Later in this section is where it explains how to make a static OLE object dynamic.
    While it doesn't specifically say it won't work for other types - it sure doesn't seem to.  I see no reason why this should be true however!  Certainly Crystal appears to be set up to allow this and the fact that the objects are not images shouldn't matter.  Why is there a picture tab and a conditional formula button next to the graphic location label on the object if it can't be used?
    I'm trying to do something similiar to Carey.  I have maps to customers in a customer list and they are in .pdf files.  The location of the map is stored in the database.  I'm putting together a report of service calls and I want to print the map with each call.  It looks like I'll have to convert several thousand .pdf files to .jpg - that should be fun!
    Any chance this limitation will be eliminated sometime soon...
    Edited by: Randy Walter on Oct 2, 2008 6:40 PM

  • Displaying Images through Servlets

    I am using Servletrunner utility to run my servlets. How can I display Images along with other HTML text, to the Browsers through Servlets?

    Print out the <img> tag. The URL you use may in turn reference another servlet that produces an image. You can look at the Java2D (and perhaps Java3D, if you want 3D images) to help you produce the images.

  • Display image on jsp page

    I have to display image on jsp page with some text output. This image is already saved at a location parallel to web-inf and is generated dynamically using a servlet. I have used img tag html to display the image. Other outputs are taking their values from database.
    First problem is that image will be taking time to display in comparision of other outouts from database. I have to refresh the page to get imageon my page.
    Second is that if I save image in a folder parallel to web-inf in my project then it will not be displaying the image.
    Can I use any jsp functionality to display image with other outputs from database. I have used "*include*". but it shows only that image and other outputs.

    Best way is to use a servlet for this.
    <img src="path/to/imageservlet?id=someidentifier">
    <!-- or -->
    <img src="path/to/imageservlet/someidentifier">In the servlet's doGet() just write code which gets an InputStream of the image (either directly generated, or just read from the local disk file system, if necessary with help of ServletContext#getRealPath(), or even from the DB by ResultSet#getBinaryStream()) and writes it to the OutputStream of the response. That's basically all. Don't forget to buffer the streams properly to speedup performance and to save memory.
    You can find here a basic example: [http://balusc.blogspot.com/2007/04/imageservlet.html].

  • h:graphicImage not displaying image in ie7

    Hello All,
    I have a jsp page in that if i click one link it will open another jsp file in a popup. In this jsp i have to display one image that image location i am dynamically creationg and displaying properly in ie6. now i have migrated ie from 6 to 7. so now that image not displaying
    Code:
    <h:graphicImage url="#{ViewUserView.currentUserBarcodeFilePath}"/>
    url is showing me correct location of the file when i displayed as output text
    <h:outputText value="#{ViewUserView.currentUserBarcodeFilePath}" />
    i.e. C:\Tomcat6\UserBarcode.png.
    previosly (i.e in ie6) this is displaying the image but now it is not working.
    Anybody please help me on this.
    Thanks
    Indira.

    Hi Indira
    Assuming you're using JSF 1.2 and Tomcat 6, you can reference/load images onto your web pages using two different ways:
    The first way*
    Add image directory (and sub-directories, if required) to your project and include this image directory in your build process via Ant, Maven or whatever tool you used. Disadvantages of this method: 1) Size of your WAR file will grow when you add more images to the image directory e.g. logos, emoticons, banner ads, etc; 2) Can't change images dynamically without having to stop/restart your web server.
    The second way*
    a) Create an image directory (and sub-directories, if required) on your file system external to your J2EE project. File system here refers to a folder (Windows), or directory (Linux & others). Advantages of this method: 1) Size of WAR file won't be big; 2) You can change images on-the-fly without having to stop/restart your web server.
    b) You also need to define the images' path in your web.xml as in the example below:
    <servlet>
             <servlet-name>ExternalImagesServlet</servlet-name>
             <servlet-class>mypackage.servlet.MyImageServlet</servlet-class>
             <init-param>
                    <param-name>RemoteURI</param-name>
                    <param-value>http://localhost/images-context</param-value>
             </init-param>       
             <init-param>
                    <param-name>AllowedContentTypes</param-name>
                    <param-value>image/gif,image/jpeg,image/png</param-value>
             </init-param>
             <init-param>
                    <param-name>DefaultFileOn404</param-name>
                    <param-value>../images/blank.jpg</param-value>
             </init-param>
    </servlet>
    <servlet-mapping>
             <servlet-name>ExternalImagesServlet</servlet-name>
             <url-pattern>/images/*</url-pattern>
    </servlet-mapping> 
    Note: In production environment, change localhost above to your fully-qualified domain name (if the images are hosted on the same server as the web site), or a name of a physical server that sits behind your firewall (if the images are hosted on a separate server to your web site).
    c) Create a servlet to load your images, for example:
    public class MyImageServlet extends HttpServlet
        private static final int DEFAULT_BUFFER_SIZE = 10240; // 10KB
        private String remoteURI = null;
        private String allowedContentTypes = null;
        public void init(ServletConfig config) throws ServletException
             super.init(config);
             remoteURI = config.getInitParameter("RemoteURI");
            allowedContentTypes= config.getInitParameter("AllowedContentTypes");
        public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
         if (remoteURI == null) {
            response.sendError(HttpServletResponse.SC_NOT_FOUND); // HTTP 404 error code
            return;
         getRemoteImage(request, response, remoteURI);
        public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
            doGet(request, response);
       public void getRemoteFile(HttpServletRequest request, HttpServletResponse response, String remoteDir) throws ServletException, IOException
            HttpURLConnection httpConn = null;
            InputStream input = null;
            OutputStream output = null;
            int statusCode = 0;
            String contentType = null;
            try
                 URL remoteURL = new URL(remoteDir + request.getPathInfo());     
                 httpConn = (HttpURLConnection) remoteURL.openConnection();
                 // if content type is unknown set to default type
                 contentType = httpConn.getContentType();
                 if (contentType == null) {
                     contentType = "application/octet-stream";
                 statusCode = httpConn.getResponseCode();
                 if (statusCode == HttpURLConnection.HTTP_NOT_FOUND)
                     response.sendRedirect(defaultFileOn404); // Oops, image not found!
                        // or uncomment the next line
                    // response.sendError(HttpServletResponse.SC_NOT_FOUND); // HTTP 404 error code
                     return;                  
                 else if (statusCode == HttpURLConnection.HTTP_OK)
                     if (allowedContentTypes.indexOf(contentType) > -1)
                         input = httpConn.getInputStream();
                         output = response.getOutputStream();
                         int count = 0;
                         byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];
                         while ((count = input.read(buffer)) > 0) {                                               
                             output.write(buffer, 0, count);
                         output.flush();
            catch (MalformedURLException e)     {             
                throw new ServletException(e.getMessage());           
            finally {
                if (input  != null) { try { input.close();  } catch(Exception ex){;} }
                if (output != null) { try { output.close(); } catch(Exception ex){;} }
    }d) Next, under your Tomcat 6's installed directory, add the content below to a file called images-context.xml (See <param-name>RemoteURI</param-value> above for reference to file name):
    <?xml version="1.0" encoding="UTF-8"?>
    <Context docBase="c:/images" /> <!-- or whatever file structure your operating system offers -->Save the images-context.xml file in your Tomcat's directory, as in:
    Tomcat
        --> conf
            ---> catalina
                  ---> localhost // save it heree) Finally, create some JSF codes like below in your JSP file:
    <h:outputLink value="../index.jsf" title="Home">
       <h:graphicImage id="logo" alt="Company logo" url="../images/logo.png" />
    </h:outputLink>Where *../images/* is referring to the reference below in your web.xml file:
       <url-pattern>/images/*</url-pattern>Build your project and you're ready to go. Tried changing a couple of the images in your image directory and see the changes appear immediately. Note: You may need to refresh your web page to force the web browser to reload the images.
    If you're using Apache, there's another way - but I'll leave that to you to do some investigation.
    That's it! Sorry, for the long answer.
    Also, there's no copyright to the above source codes (even though I wrote it). Just a mention of this forum's thread in your codes' comment is sufficient.
    Refer your friends to this thread if they are stuck with a similar problem.
    Edited by: icepax on 8/01/2010 17:21
    Edited by: icepax on 8/01/2010 17:50 Add save directory for images-context.xml file.

  • Is it possible to let Labview create displays himself dynamically?

    the number of displays can´t be fixed right now.
    i want to create a huge number of display by using a menu "create a new display". everyone should show another value from a global variable (Array).
    So i don´t want to use static elements - if i would do so, i had to create about 80 digital displays, 20 analog display and a few graphs. But i don´t need them every time - sometimes i need 3 digital and 15 analog displays, another time i need 60 digital an no analog displays. i only want to create 3 foundamental dislays and use them very often with different properties and pointers to the global variable!
    Is this possible?
    Thanks a lot...

    I have in many applications done this by using the picture control. Jean-Pierre first suggested an excellent approach to this in this link.
    http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=506500000008000000A33B0000&UCATEGORY_0=_49_%24_6_&UCATEGORY_S=0&USEARCHCONTEXT_INCLUDE_0=Ben+picture&USEARCHCONTEXT_INCLUDE_S=0&UPostedFromTimeSearchArg_0=8&UPostedFromTimeSearchArg_1=3&UPostedFromTimeSearchArg_2=2000&UPostedFromTimeSearchArg_S=4&UPostedToTimeSearchArg_0=4&UPostedToTimeSearchArg_1=9&UPostedToTimeSearchArg_2=2004&UPostedToTimeSearchArg_S=4&USEARCHCONTEXT_TIER_0=2&USEARCHCONTEXT_TIER_S=0
    You can use the "Invoke Node" to get the image of a control. If you combine this method with events configured for the picture control, you can simul
    ate normal LV objects.
    This method takes a bit bit of work, but it does allow the GUI to be taylored as your end user requires.
    You do not have to re-code all of the normal behaviour of your control elements. When a clcik is detected on a simulated device, a real LV FP object can be made visable and moved from its off-screen location to where the user clicked, and key-focus transfered. The user then interacts with the LV object that is on top of the the picture if it.
    It is not easy, but it works great!
    So as to:
    "Is it possible to let Labview create displays himself dynamically?"
    YES!
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • How to display image on Portlet ?

    Dear all,
    I am now designing an application using Oracle Portal to maintain a company's employee records.
    The application allows HR personnels to input employee information such as name, gender, age and so on. In additional, a photo of 250x300 will be uploaded to database as well.
    The application allows hr personnels to query the database for employees and the photos will be displayed on web.
    I will use JDeveloper for the development. I want to know how to display the photos on the web in Portlet?
    thanks
    George (HK)

    Well at the end of the line its still plain old html that is used to display images, to display an image in html (correct me if im wrong) the image has to be in the webfolder (or it can be a servlet that generates an image)
    You are getting the image from a database, so you need a servlet that gets this image and converts it to a format the html tag < img src="..." > understands.
    To be honest I never done this, but Im curious how you will do it.
    You could also try to use AJAX and load the image dynamically, you'll still need a servlet though. You must also understand that a portlet differs a little bit from a servlet, portlet need a portal to run, servlet can run on its own.
    Hope this helps, I hope you also get some other answers, let me know if you succeed, im curious

Maybe you are looking for