rendering of images stored in the remote path (Jdev 11.4)

Hello

I want to make the image of the remote path using the adf:image tag, but I am not able to view the images of the remote path.
If I place the images in the images web - inf I'm able to display.

Please let me know if there is a way to display images of the remote path except the path of the application?

Thank you.

Hello

If the image is in the remote path then you need to create an imageservlet which will have a path as a parameter and returns the binary stream of the output image.
would help to see if more

package servlets;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;

import java.net.URL;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import javax.servlet.*;
import javax.servlet.http.*;

import oracle.adf.model.BindingContext;

import oracle.jbo.ApplicationModule;
import oracle.jbo.Row;
import oracle.jbo.ViewObject;
import oracle.jbo.uicli.binding.JUApplication;

public class GetResource extends HttpServlet {

    private Map mimetypes;

    public void init(ServletConfig config) throws ServletException {
        super.init(config);
        logFine("GetResource servlet initialized");
        registerMimeTypes();
        logFine("GetResource servlet initialized");
    }

    private void logFine(String msg) {
        System.out.println("[" + new Date() + "]  : " +  msg);
    }
    private void registerMimeTypes() {
        mimetypes = new HashMap();
        mimetypes.put("bmp", "image/bmp");
        mimetypes.put("gif", "image/gif");
        mimetypes.put("jpe", "image/jpeg");
        mimetypes.put("jpeg", "image/jpeg");
        mimetypes.put("jpg", "image/jpeg");
        mimetypes.put("png", "image/png");
        mimetypes.put("tiff", "image/tiff");
        mimetypes.put("tif", "image/tiff");
        mimetypes.put("ico", "image/x-icon");
        mimetypes.put("txt", "text/plain");
        mimetypes.put("pdf", "application/pdf");
    }

    public void doGet(HttpServletRequest request,
                      HttpServletResponse response) throws ServletException,
                                                           IOException {
        processRequest(request, response);
    }

    public void doPost(HttpServletRequest request,
                       HttpServletResponse response) throws ServletException,
                                                            IOException {
        processRequest(request, response);
    }

    private void processRequest(HttpServletRequest request,
                                HttpServletResponse response) throws ServletException,
                                                                     IOException {
        logFine("========get resource request========");
        Map map = getQueryStringMap(request);
        String path = map.get("path");

        logFine("requested resource : " + path);
        /*URL u = new URL("file://" + url.toString());*/
        File file=new File(path.toString());
        String _file = file.getName();
        logFine("URL : " + path);
        logFine("File Name : " + _file);
        String _ext =
            _file.substring(_file.lastIndexOf(".") + 1, _file.length());
        String mimeType = mimetypes.get(_ext.toLowerCase());
        if (mimeType == null) {
            logFine("Mime Type was null");
            return;
        }
        logFine("Mime Type of file : " + mimeType);
        response.setContentType(mimeType);
        InputStream is = new FileInputStream(url.toString());
        OutputStream out = response.getOutputStream();
        byte b[] = new byte[1024];
        int read = -1;
        logFine("start read-write operation");
        while ((read = is.read(b)) != -1) {
            out.write(b, 0, read);
        }
        logFine("end read-write operation");
        is.close();
        out.close();
        logFine("========end resource request========");
    }

    public Map getQueryStringMap(HttpServletRequest request) {
        Map map = new HashMap();
        if (request.getQueryString() != null) {
            if (request.getQueryString().isEmpty())
                return map;
            String[] params = request.getQueryString().split("&");
            for (String param : params) {
                String name = param.split("=")[0];
                String value = param.split("=")[1];
                map.put(name, value);
            }
        }
        return map;
    }
}

Then in any image tag use it like this


Kind regards
David

Tags: Java

Similar Questions

  • How can I find the URL codes for images stored in the Windows Photo Gallery?

    How can I find the URL codes for images stored in the Windows Photo Gallery?

    If you want the path to the current record
    right click to the picture location of a photo...
    and choose... Properties / General tab.
    Location displays the path.

    If you have a photo saved on your hard drive
    car that was downloaded on the net...
    the original URL will appear not in
    the file.

  • How to clear the field of the image stored while the data type is LONG RAW

    Assalam O alaikoum

    I have a table of LONG RAW data type field. I made a form on that table. and the images stored in this area to help after the program.

    DECLARE
    filename VARCHAR2 (256);
    BEGIN
    filename: = GET_FILE_NAME;--(File_Filter = > ' JPEG (*.)) JPG; *. JPG; *. JPE; *. (JFIF)');
    READ_IMAGE_FILE (filename, 'JPEG', 'work_order.article_image');
    END;

    And he stored images when I commit / saves the form.

    Problem:

    I want to remove the image from this specific record field. I don't want to delete the entire record, I don't want to replace the image. I want to only empty this field.

    HOW CAN I DO?

    +"... I don't want to replace the image. I want to only empty this field... « +

    Have you tried:

    Go_Item('image_item');
    Clear_Item;
    

    François

  • How to load an image stored in the database to the point of the Image

    Hi all

    Please help me to load an image to an element of the image, the IMAGE is stored as BLOB in the database.

    Please give me the code to load that image into the next key element based on certain conditions as employee number should correspond with the identification number of the photo.

    Thanks in advance.

    If you have a table with a column of type blob and some identify and want to show this blob content as a picture in a form?

    -Create a new block based on this table, make sure that the element type of the blob column is image.
    -In the key-nextitem (or another location where you want to upload the image), put something like:

    GO_BLOCK('IMAGEITEMBLOCK');
    SET_BLOCK_PROPERTY('IMAGEITEMBLOCK', ONETIME_WHERE, 'ID=' || varContainingTheIdValue);
    EXECUTE_QUERY;
    
  • ESXi 3.5 Update 4 virtual machines cannot boot from ISO image stored on the server

    Ok

    If I have one of my virtual machines of ESXi configured to use an ISO image sitting on my server ESXi, they cannot boot from this image.  This is after you click "ESC" during startup in order to change the startup CD-ROM.  I have this a known issue, or I'm just doing something wrong?  If I have the vms use an ISO sitting on my desktop (using Infrastructure Client) it works fine.

    Or the answer is even simpler, make sure I connect at power on.

    OK, Yes!  But some of the things we take for granted... haha...

  • Portlet using the image stored on the my Oracle/Stellent Content Server

    Hi all

    The script is quite simple. I have a check image file in my Oracle/Stellent Content Server and I want to just create a simple portal with a portlet that displays this image on my weblogic Portal Server.

    How can I do this? So far I have installed the CIS_Helper on my happy server and cis admin app on my Portal Server. I have configured the SCS adapter and when I ran the criterion which must communicate with the content server, the test was OK. Im a little lost right now... What should I do?

    Thanks in advance.

    Hello

    First of all, by that you must run the sql script necessary for full text indexing as the documentation, and then run the collection rebuild cycle for tables created the first fo of indexation.

    Srinath

  • Where the images of the workspace are stored at the Apex 4.2

    Hi guys,.

    I downloaded images on the apex by selecting the workspace Image downloading. Now I want to export all images so that I do not need to download them all again in case something happens to my machine and I should be able to import all the images in one click/command in the new installation of. But I don't know where the pictures of the workspace are stored. Are images stored on the local file system or in the database? If in the database then the schema that I need to export and I will be able to import all the images in the exported file? In the case of OS file system and which directory (full path) he holds?

    Thanks and greetings

    Tushar Lapani

    Hey Tushar,

    Tushar Lapani wrote:

    I downloaded images on the apex by selecting the workspace Image downloading. Now I want to export all images so that I do not need to download them all again in case something happens to my machine and I should be able to import all the images in one click/command in the new installation of. But I don't know where the pictures of the workspace are stored. Are images stored on the local file system or in the database? If in the database then the schema that I need to export and I will be able to import all the images in the exported file? In the case of OS file system and which directory (full path) he holds?

    Images that you download via Shared component-> files-> Images

    get downloaded in the WWV_FLOW_FILES.

    You can query on WWV_FLOW_FILES to see your downloaded files.

    select
        id, flow_id, name,
        filename, title, mime_type,
        doc_size, dad_charset, created_by,
        created_on, updated_by, updated_on,
        last_updated, content_type, language,
        description, file_type, file_charset
     from
        wwv_flow_files;
    

    Include all your images and files in your application using the supporting function of the object, so whenever wen you export your application at this time, your images and your include files also get exported with the application.

    1. go to your Application -> support objects component shared icon before

    Installation -> Install Scripts ->, click Create button -> to Create Scripts for install files (under tasks) under

    According to this, you will get a list of all the CSS, image and static files to downloaded in your application, select the checkbox of the files you want to include in the export file.

    2. application -> support-> tab objects export

    Include definitions of object support in export - Yes

    Also see this Doc online: export an Application and related files and Application Deployment

    Hope this helps you,

    Kind regards

    Jitendra

  • How can I import the images stored in a folder in sequence and add a timer to change the sequence?

    Hello

    I'm actually very new to Labview and I don't have any idea about it. Can someone provide me with a VI that can import images stored in a folder in sequence.

    Example: the images stored in the folder with names like 1.bmp, 2.bmp and so on...

    I want to import bmp 1. first use and after 8 seconds 2. BMP and so on...

    Please help me with this.

    Thank you

    Hello again!

    OK, so I saved the vi in LabVIEW2012 for you.

    But really, you should take the course of introduction to LabVIEW or something. You won't get far if you can't reproduce even vi simple enough.

    Dan

  • Merge the expanded paths


    path3dissue.pngselectpathspath3dissue.png

    I ran into a problem where, as I can't merge the following extended path with a route closed, for example a square. Left is specified without paths, right image appears with the expanded paths.  I tried many options of search path without success?

    It is also possible to shrink the middle way in proportion and all other paths adapts accordingly?

    I was wondering why you are creating a complex object?

    Simply draw a circle with a thick line and apply a gradient to this trait.

    Then in the Panel gradient colors, choose 'Apply gradient across the shot' in the section of the stroke.

    For more details, check out my video on Gradient lines: http://www.jeffwitchel.net/2012/08/illustrators-amazing-new-gradients-on-strokes/

  • Best way to save the images streaming from the web to device?

    We have an app to browse a catalog this content of stream of a web server. There is an image for each product, some in JPG format and some in PNG format. Our server is fast and reliable, so everything worked without problems so far, but we would like to give users the ability to save data on their device, so they don't have to listen to every time. I've only worked with before SharedObjects, which are capped at 100kb and will not help in this situation.

    What would be the best approach for storage of images and keeping them is crushed in the updates? Save an uncompressed Bitmap uses too much storage space. Adobe's JPEGEncoder class is completely useless because it takes 10 to 30 seconds to save an image of medium size on a typical device. Also, he does not sense of re - encode jpg files, and we must preserve transparency in png.

    At the moment we are using a loader to retrieve images and using loader.content to access the image data in the code. Is it possible to save the image file in its original local format when downloaded with a charger? We would like the images stored in the application data and not available through the gallery. With regard to the registration of the data for each product (price, description, etc.), the built-in SQLite support would be enough or should we create our own files?

    Thanks for the tips!

    Ah, I got it. Existing files are checked as indicated cmholden. If the image is not stored locally, we use URLStream to load the image file on the web. We can then save the file directly via the ByteArray to the URLStream and then use our code existing loader to load the ByteArray even as a DisplayObject. I was worried there would be some downturn app to save the files, but the change in performance is negligible and of course once the images are saved on the device they charge a lot more quickly the next time the application is run!

  • Rendering of the image browser on the device controls

    Hey experts,.

    I tried to use BrowserFieldDemo to a remote web server web content rendering. However, content of the image shows image and placeholder image never make correctly on the device. The Simulator is very well. Make sure that image getResource() download code is the right place. I am running sdk 4.6.0. Here's renderOptions:

    I finally figure out this method of connection download image are different with connection download html. When I test Simulator, I use default MDS, one device I've tested via WIFI and couldn't make connection on image download

  • The paths on the remote share will correct itself by FileHistory?

    I have imported the photos under my user profile, sorted and modified and moved to the Public.

    On the computer that hosts the share FileHistory, I noticed that the images are stored in the path to my user profile and not Public. Because the photos are currently stored in Public, it would make sense that FileHistory move from their current location for under the Public folder. FileHistory happen finally?

    Hello

    Thank you for the update.

    Historical files would not climatiqueLes action automatically. You must do it manually.

    I suggest you to refer to the section 'reselect your historical files drive' and enter the network location of the file history once more and check.

    What happens if something is wrong in the history of the files?

    http://Windows.Microsoft.com/en-in/Windows-8/what-something-goes-wrong-file-history

    Let us know if you have any additional questions.

  • File name of the Image displayed in PSE 8 does not match the file path name in Windows 7

    I recently got a new computer. I've updated on my computer Windows XP of PSE 5.0 to 8.0 PSE.  Then, I moved my files to the new computer that is running Windows 7, following the instructions that I have received on a previous post.  I copied the catalog file and the image files on the C drive of the old computer to the new computer (file catalog to the specified location in the information system;  images of my images).   Everything seems to have worked beautifully without having to go through a great struggle to reconnect.  The organzer seems to have found all of the images and I can put them in the editor as well.  However, when I look at the properties of a given image displayed full file name is that it was on XP: C:\Documents and Settings\ < username > \My Documents\My Pictures\ < folder name >-< Filename > rather than the path as it is in Windows 7, i.e. C:\Users\ < username > \My Pictures\ < file name >-< Filename >.  I am new to Windows 7 then maybe miss me something unique to Windows 7 but I'd like information.

    You are using the alias of the special folder that Vista and Windows 7 create to maintain backward compatibility (Microsoft continues to change how and where are stored the documents of users).   On Windows 7:

    C:\Documents and Settings\\My Documents\My photos

    is a special type of alias in the file:

    C:\Users\\Pictures

    (AndC:\Users \My Pictures is yet another kind of Windows 7 special alias, a 'library', which includes the folder C:\Users\Pictures.)

    Whenever an application like PES refers to the old location, C:\Documents and Settings\\My Documents\My photos, Windows that automatically converts backstage in C:\Users\\Pictures.   But Windows Explorer is configured to prevent you to access C:\Documents and Settings\ interactively - only programs like PES are able to do.  Microsoft wants users of Windows Explorer to always use the name of 'new', C:\Users\\Pictures.

    In your case, your catalog contained the old paths of XP folder, and Windows is automatically translate on the fly for new paths, unbeknownst to PSE.

    Like most of the backward compatibility hacks, this does not work perfectly.  PSE believe that the old road and new road are two completely different cases.  I'm not positive, but I think that there are opportunities for PSE to get confused by that.   When you import new pictures, they get recorded in the Catalog under the new folder paths.

    In my previous recommendation about how to move to the new computer, I had assumed you would probably change user names and locations of photo and so you would have to make a reconnection, and you would not have met it.  If I thought that you were not have need to reconnect, I would have recommended not not using this method, but rather using Backup/Restore (my first recommended method) - my bad.

    It would be nice if your current catalog and the PES works pretty well.   But there is at least a small risk that the road of PSE will get confused by old and new folder names.  The best way to avoid this would be to start again and use the backup/restore method to move your catalogue, which is more effort on your part.  But because I do not understand the risk, I can't tell you if you should be worried about it.   No doubt do tests: editing, import and edition of new photos, use view > view of the location of the folder, try to rename and move the old photos and the new folders, try the Photo Downloader, etc.

  • How to create the image that was stored on the HARD drive

    Hello

    When I fixed my windows, I chose "Restore Factory Setting" options.
    This happens to reformat my hard drive and I lose the "TOSHIBA HDD Recovery" image.

    Is it possible to create this image again?

    Thanks in advance for your help.

    Hello

    The use of the Toshiba HDD image would format the HARD drive, but should not remove the Toshiba HDD image files that are stored on the second partition!
    That's why I put t know why you said you lost the image of Toshiba HDD.
    That is a little strange.

    On the other hand, you can try to create the recovery disk using tool of preinstalled Toshiba Toshiba recovery disc Creator called.
    This tool helps you to create the recovery disk using Toshiba image files stored on the second partition.
    I think you should try this.

    See you soon

  • Where the photos are normally stored on a Mac computer? In the folder images in the Finder on my Mac, I see a file called "Library.photoslibrary Photos" i.e. 28.52 GB but I also have about 160 other image files in the same folder. But in pictures,.

    Where the photos are normally stored on a Mac computer? In the folder images in the Finder on my Mac, I have a file named "Library.photoslibrary Photos" i.e. 28.52 gb and another folder called 'iPhoto Library.migratedphotolibrary' i.e. 4.95 GB, but then I have also on the 160 other photo and video files in the same folder. But in my Photos app, it says that I have 6 260 'elements '.

    The pictures that you have imported into the photo library are, by default, stored inside the package (not file) "Library.photoslibrary Photos" in your pictures folder. The 'iPhoto Library.migratedphotolibrary' package would contain photos that have been stored in your library, iPhoto at the time of the migration.

    The other files in the pictures folder are that: other files. Also, they can be in libraries if you imported and has not deleted the copies lying around in the images.

Maybe you are looking for