How to include images into a servlet

Hi guys,
I found out that I can't include both the "setContentType("image/gif")" and the "setContentType("text/html")" in a servlet. I've tried different methods, but I can't get it right.
Could anyone tell how to do that...?
Thanks...

I beg your pardon? You want to send text and image in the same response? Can't be done. If you go and look at pretty much any HTML page on the web you will see how to include images in HTML.

Similar Messages

  • How to include images in my app

    hi all.
    I'm using Apex 2.1 over XE.
    I'm sorry but i can't find any thread related to how to include images in my app.
    I've uploaded several trough shared componentes / files / images, but don't know how to use it, for example, in an HTML region, as header of the page.
    Thanks a lot for your help.
    Fernando

    Hi,
    I have used four different ways to display images in my applications depending on which method is the fastest to refresh.
    1. Under Application Attributes > Edit Standard Attributes > Substitutions enter your substitution string (MY_IMAGE_URL) and substitution value(http://somewhere/img)
    and then in the region or template use the following syntax &MY_IMAGE_URL. in your html tags eg. img src="&MY_IMAGE_URL./banner.png" width="x" height="x">)
    I have found this the best for image refresh speed, especially if the image is already cached.
    2. Load your image up into Apex and don't associate it with any application and use the following tag img src="#WORKSPACE_IMAGES#banner.png" width="x" height="x" alt="">
    Good for development as all images not associated to an application are available.
    3. Load your image up into Apex and associate it with an application and use the following tag img src="#APP_IMAGES#banner.png" width="x" height="x" alt="">
    This can be a pain during development when your application numbers continually change.
    4. Use standard http address <img src="http://somewhere/banner.png" width="x" height="x">
    Ben
    Message was edited by:
    Benton

  • How to load image into picturebox

    Hi! Does anyone know how to load image into picturebox by using J2ME? And how to crete the picturebox in the forst place?
    Thanks!
    Regards,
    Jaceline

    You want java.awt.Toolkit.getImage() and java.awt.Graphics.drawImage().
    Ted.

  • How to split image into smaller (same size) pieces?

    Hi all,
    My question is how to split image into smaller (same size) pieces, using Photoshop elements 13? Could anyone help me with this one?
    Thanks!

    Use the Expert tab in Editor (I think that is what it is called in PSEv.13)
    You may find the grid helpful. Go to View>Grid. It will not print, but will help to orient you. You can set up the gridlines to suit via Edit>Preferences>Guides and Grid. If you want to partition the picture in to 4 uniform pieces, it would be Gridline every 50%, Subdivision 1. Also, go to View>Snap to>Grid.
    Set up the Rectangular marquee tool: If the picture is 6" wide & 4" high, enter width=3in & height=2in.on the tool's option bar. This will be a fixed size.
    Click and select one quadrant, press CTRL+J to place this quadrant on a separate layer
    Repeat for the other 3 quadrants
    You should end up with 5 layers : Background, and layers 1, 2, 3, 4.

  • How to add images into a java application (not applet)

    Hello,
    I am new in java programming. I would like to know how to add images into a java application (not an applet). If i could get an standard example about how to add a image to a java application, I would apreciated it. Any help will be greatly apreciated.
    Thank you,
    Oscar

    Your' better off looking in the java 2d forum.
    package images;
    import java.awt.*;
    import java.awt.image.*;
    import java.io.FileInputStream;
    import javax.imageio.ImageIO;
    import javax.swing.*;
    /** * LogoImage is a class that is used to load images into the program */
    public class LogoImage extends JPanel {
         private BufferedImage image;
         private int factor = 1; /** Creates a new instance of ImagePanel */
         public LogoImage() {
              this(new Dimension(600, 50));
         public LogoImage(Dimension sz) {
              //setBackground(Color.green);      
              setPreferredSize(sz);
         public void setImage(BufferedImage im) {
              image = im;
              if (im != null) {
                   setPreferredSize(
                        new Dimension(image.getWidth(), image.getHeight()));
              } else {
                   setPreferredSize(new Dimension(200, 200));
         public void setImageSizeFactor(int factor) {
              this.factor = factor;
         public void paintComponent(Graphics g) {
              super.paintComponent(g);
              //paint background 
              Graphics2D g2D = (Graphics2D) g;
              //Draw image at its natural size first. 
              if (image != null) {
                   g2D.drawImage(image, null, 0, 0);
         public static LogoImage createImage(String filename) { /* Stream the logo gif file into an image object */
              LogoImage logoImage = new LogoImage();
              BufferedImage image;
              try {
                   FileInputStream fileInput =
                        new FileInputStream("images/" + filename);
                   image = ImageIO.read(fileInput);
                   logoImage =
                        new LogoImage(
                             new Dimension(image.getWidth(), image.getHeight()));
                   fileInput.close();
                   logoImage.setImage(image);
              } catch (Exception e) {
                   System.err.println(e);
              return logoImage;
         public static void main(String[] args) {
              JFrame jf = new JFrame("testImage");
              Container cp = jf.getContentPane();
              cp.add(LogoImage.createImage("logo.gif"), BorderLayout.CENTER);
              jf.setVisible(true);
              jf.pack();
    }Now you can use this class anywhere in your pgram to add a JPanel

  • How to include images in your swf?

    I am making a website with flash builder. The images i need, i have to upload to the server and have to load everytime you click on a menu button. That takes time and is very bad for my limited banthwidth (or something). So, i want to know how i can include images in the swf, so they just have to load one time.
    Thanks, Evert.

    Have you looked into embedded images?
    This might help: http://livedocs.adobe.com/flex/3/html/help.html?content=embed_4.html

  • How to insert image into table and to in Oracle 9i intermedia?

    Mr Lawrence,
    I want to ask something:
    I use Oracle 9i intermedia
    If i use this script:
    CREATE TABLE images (
    file_name VARCHAR2(100) NOT NULL,
    image ORDSYS.OrdImage
    then
    CREATE OR REPLACE DIRECTORY imgdir AS 'd:/data';
    then
    INSERT INTO images (file_name, image)
    VALUES ('tree', ORDSYS.ORDImage.init('file','imgdir','tree.jpg' ));
    I put tree.jpg in directory d:/data in my hard drive.
    Is my tree.jpg file had already get in to my images table?
    I'm little confuse, because when i check my table with this script:
    select file_name, i.image.getWidth() from images i;
    it's show that my i.image.getWidth() for file_name tree is empty.. that mean my tree.jpg doesn't get in to my table.. am i correct?
    N also i want to ask how to display to screen all of my image from images table?
    Is it posible Oracle 9i intermedia to support display image from table?
    How?
    thanks Mr Lawrence

    -- First step would be to create a directory in oracle and map it to the folder where your image resides.
    create directory image_dir as *'c:\image_dir';*
    Then you would have to use a procedure to insert the image in your table. SO first create a table to hold the image. Note that you have to use a BLOB to insert the image.
    CREATE TABLE test_image
    ID NUMBER,
    image_filename VARCHAR2(50),
    image BLOB
    Now let's write the procedure to insert the image in the table above.
    CREATE OR REPLACE PROCEDURE insert_image_file (p_id NUMBER, p_image_name IN VARCHAR2)
    IS
    src_file BFILE;
    dst_file BLOB;
    lgh_file BINARY_INTEGER;
    BEGIN
    src_file := BFILENAME ('image_DIR', p_image_name);
    -- insert a NULL record to lock
    INSERT INTO temp_image
    (ID, image_name, image
    VALUES (p_id, p_image_name, EMPTY_BLOB ()
    RETURNING image
    INTO dst_file;
    -- lock record
    SELECT image
    INTO dst_file
    FROM temp_image
    WHERE ID = p_id AND image_name = p_image_name
    FOR UPDATE;
    -- open the file
    DBMS_LOB.fileopen (src_file, DBMS_LOB.file_readonly);
    -- determine length
    lgh_file := DBMS_LOB.getlength (src_file);
    -- read the file
    DBMS_LOB.loadfromfile (dst_file, src_file, lgh_file);
    -- update the blob field
    UPDATE temp_image
    SET image = dst_file
    WHERE ID = p_id AND image_name = p_image_name;
    -- close file
    DBMS_LOB.fileclose (src_file);
    END insert_image_file;
    Now execute the procedure to insert the image.
    EXECUTE insert_image_file(1,'test_image.jpg');
    Thanks,
    Aparna

  • How to include components into mxml file?

    I have an mxml file with multiple states and it is getting
    quite large. I would like to divide these states into their own
    components. How can i include these into the mxml file?
    Thanks!

    I couldn't be happier that you asked this question and if you
    don't mind I'd like to extend on it a touch since it directly
    relates to my topic.
    I am right with Dr. Goomba (Great name) when it comes to
    filesize of a single application.
    The flash player has always been a big proponent of small
    file size and fast dowloads to ensure our users have a pleasant
    experience in our applications. I have been going through the
    documentation tirelessly and the only mention I really see as a
    supporter of that theory is "RSL" documentation which, believe it
    or not, actually advises against them unless you are using them
    across multiple apps.
    So, my question is a tack on to Dr. Goomba (Answer his first,
    this is just a supporter):
    Has Flex 2 moved us away from fast delivery? I have an
    application already up to 300k that could easily reach the 700k
    range (I think, based on my total progress so far) - It doesn't
    seem to me that the focus is still on loading things in parts like
    the MX 2004 RIA days.

  • How to include  images in BAM reports

    Hi all,
    In Oracle 11g BAM , i can see some already existing Demo reports, i the Active Studio.
    in that demo reports i can see a report called SLA Violation.Here in this SLA Vioaltion report there is Updating Orderded list within the list they are showing some images .
    can some one help me how to add images like that..? or tell me the steps..
    i tried creating the similar updating ordered list in my sample report and gave the image links gived in that demo report
    " _switch({Process Due Soon SLA}) case(true):(<span style='width: 8px'><img src='../Images/TradeSubmitted.png'/></span><span style='padding-left: 4px;vertical-align:top;'>Submitted</span>) default( <span style='width: 8px'><img src='../Images/TradeFine.png'/></span><span style='padding-left: 4px;vertical-align:top;'>Fine</span>")_but in the updated ordering list instead of the image im getting entries like this " ):(<span style='width: 8px'><img src='../Images/TradeSubmitted.png'/></span><span style='padding"
    Any suggestions on this is Really appreciated..
    TIA,
    Karthik
    Edited by: karthik !! on 20 Jun, 2011 7:28 AM

    Hi,
    I have used four different ways to display images in my applications depending on which method is the fastest to refresh.
    1. Under Application Attributes > Edit Standard Attributes > Substitutions enter your substitution string (MY_IMAGE_URL) and substitution value(http://somewhere/img)
    and then in the region or template use the following syntax &MY_IMAGE_URL. in your html tags eg. img src="&MY_IMAGE_URL./banner.png" width="x" height="x">)
    I have found this the best for image refresh speed, especially if the image is already cached.
    2. Load your image up into Apex and don't associate it with any application and use the following tag img src="#WORKSPACE_IMAGES#banner.png" width="x" height="x" alt="">
    Good for development as all images not associated to an application are available.
    3. Load your image up into Apex and associate it with an application and use the following tag img src="#APP_IMAGES#banner.png" width="x" height="x" alt="">
    This can be a pain during development when your application numbers continually change.
    4. Use standard http address <img src="http://somewhere/banner.png" width="x" height="x">
    Ben
    Message was edited by:
    Benton

  • How to include images in HTML email

    Hi,
    from Oracle DB, using UTL_SMTP I am sending emails to customers, it works OK but my problem is that include images do not show when email is open (show typical box with a 'X' in it) , Is there any option to do it??? in HTML? in UTL_SMTP.
    Others options?
    Thanksin advance.

    Hello,
    I would invite you to post this question on the PL/SQL.
    I know that it is not directly answering your question but could be interested for the community, here an article of how to do such think in Javamail
    Regards
    Tugdual Grall

  • How to include image file in ard

    Dear members,
    I have to include one more menu next to reports menu in sap B1. I need to include the picture symbol.
    Can anybody inform me how to include the image file while making the add-on.Normally we include the exe file and dll files.Is there any specific methods to include the image.Please kindly let me know.
    Regards,
    Venkatesh.R

    in srf attached image button.
    and write code
    Dim img As SAPbouiCOM.PictureBox
                    img = oForm.Items.Item("14").Specific
                    SPath = CurDir() '.Remove(Len(CurDir) - 3, 3)
                    img.Picture = (spath & "\Avijit.bmp")
    Spath is nothing butthe location where u put all files .
    regards,
    Avijit

  • How to put image into pdf file in which image is set it in particuler frame size

    hi, i m creating app for generate pdf in which i can set image into pdf but the image sizze is large so the image is display over the text and how can i set text into pdf and also how to set textfilelds data into pdf or tableview data into pdf.help me plz

    Are you looking for image in selection column or as a separate column?
    --Shiv                                                                                                                                                                               

  • How to transfer images into bytecodes

    i need a help to transfer images from server to proxy and then transfer into client,at that time if that particular image is already there in proxy then the client directly retrieve images from proxy not from server.which replacement algorithm is suitable fror this.how to cache images in proxy.pls reply me..

    by using a caching proxy server. That should do the trick automaticly for you. But why. It's not that you realy need vast amount's of bandwidth or power to serve phones with images...

  • Question - how to layer images into one

    I've been looking for the "how to steps" to layer images into one. All the sites talk about "photoshop" but none actually brake down as which version etc...if you know the steps please post it up so I can stop looking. Thank you!!

    I'm creating a new website and wanted to have 5 pictures layered onto one another on our company logo. Like on this web page at the top. I'm using Adobe Photoshop CS4 Extended
    http://allwebcodesign.com/templates/T27dChromeNavy/Graphic-LOGO-sample.htm

  • How to insert images into oracle databse......

    hi,
    i have to insert images into oracle database..
    but we have a procedure to insert images into oracle database..
    how to execute procedure.
    my images file is on desktop.
    i am using ubuntu linux 8.04..
    here i am attaching code of my procedure
    create or replace PROCEDURE INSERT_BLOB(filE_namE IN VARCHAR2,dir_name varchar2)
    IS
    tmp number;
    f_lob bfile;
    b_lob blob;
    BEGIN
    dbms_output.put_line('INSERT BLOB Program Starts');
    dbms_output.put_line('--------------------------');
    dbms_output.put_line('File Name :'||filE_namE);
    dbms_output.put_line('--------------------------');
    UPDATE photograph SET image=empty_blob()
    WHERE file_name =filE_namE
    returning image INTO b_lob;
    f_lob := bfilename( 'BIS_IMAGE_WORKSPACE',filE_namE);
    dbms_lob.fileopen(f_lob,dbms_lob.file_readonly);
    --dbms_lob.loadfromfile(b_lob,f_lob,dbms_lob.getlength(f_lob));              
    insert into photograph values (111,user,sysdate,b_lob);
    dbms_lob.fileclose(f_lob);
    dbms_output.put_line('BLOB Successfully Inserted');
    dbms_output.put_line('--------------------------');
    commit;
    dbms_output.put_line('File length is: '||dbms_lob.getlength( f_lob));
    dbms_output.put_line('Loaded length is: '||dbms_lob.getlength(b_lob));
    dbms_output.put_line('BLOB Committed.Program Ends');
    dbms_output.put_line('--------------------------');
    END inserT_bloB;
    warm regerds
    pydiraju
    please solve my problem
    thanks in advance.......

    thank you
    but i am getting the following errors.
    i connected as dba and created directory on /home/pydiraju/Desktop/PHOTO_DIR'
    and i gave all permissions to scott user.
    but it not working . it gives following errors.
    ERROR at line 1:
    ORA-22288: file or LOB operation FILEOPEN failed
    Permission denied
    ORA-06512: at "SYS.DBMS_LOB", line 523
    ORA-06512: at "SCOTT.LOAD_FILE", line 28
    ORA-06512: at line 1
    Warm regards,
    Pydiraju.P
    Mobile: +91 - 9912380544

Maybe you are looking for

  • ITunes and Front-Row no longer in Sync

    Since I moved my whole iTunes library to an external drive, Front-Row is no longer showing if a TV Show is new or not. And it won't update the iTunes counter for that show. The video-podcasts are working correctly. When I download a new one, it shows

  • Php-cgi install issue

    I had the php package installed until I realized I needed php-cgi for what I want to do.  When I tried to install php-cgi it complained about php being installed so I removed php.  But now when I try to install php-cgi, I get this... % pacman -S php-

  • Run Time Engine Web Service

    Hello Gents, Anybody knows why I can't access to VI (*.exe) on remote PC. On remote PC has been installed only standard 8.6 Run Time Engine. Do I need to install additional parts like NI LabVIEW Run-Time Engine Web Server or/and LV Web Server? And is

  • Error in external tax system: Line: 0 - 0440 TxJCdSTIO The fleximap module

    Hi, We have a third-party purchase order where in PO is created in our US company code but the delivery is to a plant belonging to a BRazil company code. (Delivery address is in Brazil). Problem is when the user is trying to change the tax code on th

  • Tests do not run on Windows 2003 server

    I got all my unit tests running fine on my local machine but I had a few issues getting them to work on the build server. The first problem was that ant task was looking for c:\windows, the 2003 windows directory is c:\winnt. A change to WindowsSWFLa