How to display an image located in the WEB-INF directory?

Basically, When a user registers, they a directory is created with their username that holds images that they can upload. How do I display those images. All I am holding in the database is the location of the images.
ive tried
<img src="/WEB-INF/users/testuser/picture.jpg" />
but this doesnt work and for obvious security reasons shouldnt.. but is there another way of doing what i want to do? perhaps a custom tag? thanks
Jazz

You would have to write a generic servlet that would return an image
<img src="/getImage?user=testuser&pic=picture.jpg" />Your servlet would basically fetch the file from under web-inf, and then stream it back to the user.
Methods to use:
servletContext.getRealPath() (to help find the file on disk), relative to your web app
getOutputStream (as opposed to getWriter)
It is only in this way that you can access files on the server outside of the public web directories.
Hope this helps
Cheers,
evnafets

Similar Messages

  • How can I reference a dtd in the Web-Inf directory from an xml file?

    Hi,
    I've placed my test.xml and test.dtd files in the following
    direcory (part of my web application)
    weblogic\config\MyDomain\applications\sample\Web-inf
    When I refer to the dtd from the xml file, as follows,
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE application SYSTEM "test.dtd">
    Weblogic tries to look for the dtd in the weblogic directory(the
    place where I started the server from). How can I get it to read
    the dtd in the Web-inf directory?
    I'm using Weblogic6.0 SP1 on Windows NT 4.0
    Thanks.

    Two options:
    1) Use SYSTEM "http://localhost:7001/sample/test.dtd"
    2) Or use XML registry in WLS6.0
    Cheers - Wei
    "Paromita" <[email protected]> wrote in message
    news:3aaff997$[email protected]..
    >
    Hi,
    I've placed my test.xml and test.dtd files in the following
    direcory (part of my web application)
    weblogic\config\MyDomain\applications\sample\Web-inf
    When I refer to the dtd from the xml file, as follows,
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE application SYSTEM "test.dtd">
    Weblogic tries to look for the dtd in the weblogic directory(the
    place where I started the server from). How can I get it to read
    the dtd in the Web-inf directory?
    I'm using Weblogic6.0 SP1 on Windows NT 4.0
    Thanks.

  • How to load/save a file in the WEB-INF?

    how can i load and save files in the WEB-INF directory using servlet?

    This doesn't save files. And in order to reuseability and maintainability, I'd rather use java.io and passing the path/filename around in File object.
    You can retrieve the absolute path for "/WEB-INF" byString absoluteWebInfPath = getServletContext().getRealPath("/WEB-INF");Then you can use that to read/write files.
    File file = new File(absoluteWebInfPath, "filename.ext");
    InputStream input = FileUtil.read(file);
    FileUtil.write(file, input);and so on.

  • Serializing a JavaBean to the WEB-INF directory or subdirectories

    Hello, I'm hoping someone can help me on this.
    I'm working with two scenarios in WSAD Enterprise Edition 5.0.0.2 for
    serializing a JavaBean (called AddressBean) to the following location
    in my Web application:
    /WEB-INF/classes/resources/serializable
    The data corresponding to the bean I'm serializing is being stored in
    a file with a name that makes it unique on the file system (e.g.
    jeff.ser, jill.ser). In the first scenario, I start by getting a
    FileOutputStream, then an ObjectOutputStream which is then used to
    write my JavaBean as needed. All of this is done in the first
    scenario from a JSP located in:
    myWebApp/Web Content/jsp/JSP1.jsp
    That works fine and as I'd expect. However, I'm not able to do that
    in the second scenario. In this scenario, I created an additional
    method in the bean itself that will actually serialize an object of
    its own type to the same directory structure that I showed above (i.e.
    under the WEB-INF directory). That is, in my bean, I have the
    following:
    public void writeDataToFile(AddressBean bean, String path) {
    FileOutputStream fos = null;
    ObjectOutputStream oos = null;
    try {
    fos = new FileOutputStream(path);
    oos = new ObjectOutputStream(fos);
    oos.writeObject(bean);
    oos.close();
    catch(Exception e) {
    e.printStackTrace();
    In this scenario, another JSP (call it JSP2.jsp) is creating an
    instance of AddressBean by using the jsp:useBean tag. The real path
    for the .ser file is figured out in the JSP code (same as was done in
    JSP1.jsp), and then I delegate the serialization part to the bean
    itself like so:
    // In JSP2.jsp
    <jsp:useBean id="ab" class="examples.beans.simple.AddressBean" />
    AddressBean address = (AddressBean) pageContext.getAttribute("ab");
    // get the path
    String path = ...
    String realPath = application.getRealPath(path);
    // write the object
    address.writeDataToFile(ab, realPath);
    What happens is that I get a FileNotFoundException while trying to
    create the FileOutputStream in the writeDataToFile() method in
    AddressBean at runtime. The message in the console states:
    java.io.FileNotFoundException:
    C:\WINNT\Profiles\myself\Personal\IBM\wsad\myworkbench\myWebApp\Web
    Content\ (Access is denied)
    The source file for AddressBean is located at:
    myWebApp/Java Source/examples.beans.simple.AddressBean
    WHAT is going on here!? I know that everything stored underneath the
    WEB-INF directory is not served to clients so I'm also assuming that
    whatever stored in that directory or its subdirectories is not
    accessible to clients by default. The only real difference between
    the two scenarios that I've described is that in the second one, the
    attempt to get a FileOutputStream is being made by a resource (i.e.
    AddressBean) that is outside of the "Web Content" directory structure
    in WSAD. However, the "Java Source" directory, which contains the
    package housing my AddressBean class, is also under myWebApp so I'm
    not seeing what the problem is at the moment.
    If anyone has any ideas, suggestions, solutions, please let me know.
    I'm stumped. Thank you!
    Jeff

    I figured it out, and it was my mistake. The problem was in a method defined in my AddressBean class that would take a String argument and use it to help create a unique file name (i.e. one with a .ser extension to contain the serialized bean data) for purposes of serialization later.
    Basically, I was using a local variable in the method unintentionally instead of the instance variable that I had defined in the bean so my path value was null at runtime--hence the FileNotFoundException.
    I'm still not sure why the (Access is denied) message was appearing, but I suspect it was b/c the absolute path that I'd end up with at runtime wasn't kosher; or, not having a destination .ser file was the problem.
    In any event, I fixed the mistake and could serialize a JavaBean in several ways:
    1. From a JSP directly
    2. By using a method defined in the JavaBean itself
    3. By passing on the request, which contained the JavaBean as an attribute, to a servlet that took care of the serialization
    Jeff

  • Storing .jsp files in the web-inf directory

    Has anyone ever heard about storing JSP files in the web-inf directory instead of the web app root directory.
    Apparently it improves security.
    If this is so, how is the user suppose to access the jsp file since I thought that users were not able to access what is stored in the web-inf directory.
    Any thoughts
    Thanks
    Nat

    I didn't tyr this but I think it is possible. You can do it using <servlet-mapping/> as you do with any other servlet.
    For example include lines below, in web.xml of web-inf,
    <servlet>
    <servlet-name>ReportRouter</servlet-name>
    <jsp-file>/web-inf/jsp/ReportRouter.jsp</jsp-file>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>ReportRouter</servlet-name>
    <url-pattern>/myrouter</url-pattern>
    </servlet-mapping>
    This may work. Don't you think so?
    Sudha

  • How to display an SAP document on the web (ECC 6.0)

    Hello all,
      currently upgrading from 46C to ECC60 and we are having trouble with one of our current processes. 
    We currently have a custom RFC that creates spool files and turns them into a PDF stream via CONVERT_OTFSPOOLJOB_2_PDF.  The RFC is called from one of our web applications that then displays the document via PDF on the web.
    We are having trouble using this same process in ECC 6.0 so I'm wondering if there is a different approach to do this in ECC 6.0.
    History of what has been done so far.
    1) since we are now on a UNICODE system the PDF stream sent via the RFC call was displaying chinese characters instead of "%PDF" etc (2hex char vs 4hex char). We attempted to fix this by using the method cl_abap_conv_in_ce=>create to convert each line of the PDF stream.
    2) After inserting the method some of the documents started working but others are getting a parsing error.
    We are looking to see if anyone knows of a more standard approach to getting the same thing done.

    We have experienced the same problem since we upgraded to ECC 6 and unicode last week.  The suggested code worked but there was a step missing in the example that I would like to share.
    The spool output was table TLINE which is 134 characters.  Once you convert to non-unicode you actually have to put the results in a 268 char table.  When you read it in .NET and convert it to a binary array before passing it to Acrobat for viewing you have to make sure that you pad each record with spaces up to 268 charactes.  This was key!
    Here is the code from our RFC after calling the CONVERT_OTFSPOOLJOB_2_PDF with a spool id:
    data: PDF STRUCTURE  ZC268_STRUCT occurs 0 with header line.
    call function 'CONVERT_OTFSPOOLJOB_2_PDF'
      exporting
        src_spoolid                    = f_rqident
      tables
        pdf                            = pdf.
    data:     rf_conv type ref to cl_abap_conv_in_ce.
    rf_conv = cl_abap_conv_in_ce=>create( encoding = 'NON-UNICODE' ).
    data: fta_data type table of zc268_struct with header line.
    data: f_str    type string.
    field-symbols: <f_src> type x.
    loop at pdf assigning <f_src> casting.
         call method rf_conv->convert(
          exporting input = <f_src>
          importing data  = f_str ).
          fta_data        = f_str.
          append            fta_data.
          clear             fta_data.
    endloop.
    The data in fta_data can be passed to .NET
    I hope that helps.
    Hussam

  • How can I forward to a jsp under the WEB-INF directory?

    I have a webapp with a jsp that forwards to a jsp called /WEB-INF/pages/secure.jsp When I try to forward to it, I get the error:
    "trying to GET /mywebapp/WEB-INF/pages/secure.jsp, deny-existence reports: denying existence of /web/webapps/mywebapp/WEB-INF/pages/secure.jsp"
    How can I forward to this page?
    Thanks,
    Micah

    Craig - I'm trying to do something very similar - build a waiting page into the
    flow. I've got a support case open (to get the BEA recommended approach) but so
    far have had no luck. Let me know if you've found the answer - or are still struggling.
    Cheers,
    Niall
    [email protected] (Craig Coffin) wrote:
    I am trying to get a JSP in a portlet to forward to a Webflow URL,
    without much success...
    The following code produces the ubiquitous "Functionality temporarily
    unavailable" message, presumably because jsp:forward chokes on the
    absolute URL:
    <c:set var="url">
    <portlet:createWebflowURL event="next"/>
    </c:set>
    <%
    // convert to a scripting variable for the jsp:forward tag
    String url = (String) pageContext.getAttribute("url");
    %>
    <jsp:forward page="<%=url%>"/>
    Using c:redirect fares little better. This code produces an empty
    portlet:
    <c:set var="url">
    <portlet:createWebflowURL event="next"/>
    </c:set>
    <c:redirect url="${url}"/>
    The closest I've been able to get is to have the user click a link to
    get to the next page, but I'd like to have an automatic forward rather
    than introduce another mouse click:
    ">
    Click to continue...</A>
    Am I missing something obvious? Any help would be appreciated...
    Thanks,
    -- Craig

  • Support for JSP's located in WEB-INF directory

    Several application servers support the use of placing JSP pages underneath the WEB-INF directory, to insure that only server side workflow forwards requests to those pages and not direct URL access. IN addition the JSTL specification supports the use of
    <c:import url="/WEBINF/published/campaign_Arts.jsp" />
    Does OC4J 9.0.3 support this syntax? I cannot get it to work. Is there an application configuration file I need to update to support this?
    Thanks

              thank you for your reply...
              but...
              My problem is that i want to serve jsp pages that include various other jsp pages.
              But i don't want those other pages to be served directly. The approach of putting
              the jsp files in the WEB-INF, or in a sub directory of it, worked fine on Tomcat.
              The way i look at it is that the server has direct access to them when putting
              togetter the main jsp, but they can't be accessed from the outside. But this seems
              not to be the case.
              Any ideas?
              "ilya Devers" <[email protected]> wrote:
              >The WEB-INF is not perceived as a directory to the engine. Resources
              >in it
              >are not exposed and should not. It can hold sensitive resources such
              >as
              >application deployment descriptors that can contain database log in
              >information to name something. The engine should never serve resources
              >located here.
              >
              >This directory should only contain the normal directories: lib and classes,
              >and the web.xml files (and weblogic.xml).
              >
              >Hope this helps.
              >
              >ilya
              >
              

  • How to display URL images and URL link (html) from Smartforms?

    Hi Gurus,
    I'm having difficulty on how to display targeted URL images and URL link from the smartforms, after i sending it out as html mail. The mail i sent just can be preview as a plain text, which can't execute the html code that i put inside the smartforms itself. I follow a few step from this very useful blog.. Hopefully, you guys can give me some solutions or ideas on this.
    /people/pavan.bayyapu/blog/2005/08/30/sending-html-email-from-sap-crmerp -thanks to Pavan for his useful blog.
    My code is like this..
    <--- Start Code.
    FORM call_smartforms.
      DATA : lv_subject TYPE so_obj_des,
             lc_true(1) VALUE 'X',
             lw_control_parameters TYPE ssfctrlop,
             lw_output_options TYPE ssfcompop,
             lc_graphics(8) VALUE 'GRAPHICS',
             lw_xsfparam_line TYPE ssfxsfp,
             lc_extract(7) VALUE 'EXTRACT',
             lc_graphics_directory(18) VALUE 'GRAPHICS-DIRECTORY',
             lc_mygraphics(11) VALUE 'mygraphics/',
             lc_content_id(10) VALUE 'CONTENT-ID',
             lc_enable(6) VALUE 'ENABLE',
             lw_job_output_info TYPE ssfcrescl,
             lw_html_data TYPE trfresult,
             lw_graphics TYPE ssf_xsf_gr,
             lt_graphics TYPE tsf_xsf_gr,
             lv_html_xstr TYPE xstring,
             lw_html_raw LIKE LINE OF lw_html_data-content,
             lv_incode TYPE tcp00-cpcodepage VALUE '4110',
             lv_html_str TYPE string,
             lv_html_len TYPE i,
             lc_utf8(5) VALUE 'utf-8',
             lc_latin1(6) VALUE 'latin1',
             lv_offset TYPE i,
             lv_length TYPE i,
             lv_diff TYPE i,
             lt_soli TYPE soli_tab,
             lw_soli TYPE soli,
             lc_mime_helper TYPE REF TO cl_gbt_multirelated_service,
             lv_name TYPE mime_text VALUE 'sapwebform.htm',
             lv_xstr TYPE xstring,
             lw_raw TYPE bapiconten,
             lt_solix TYPE solix_tab,
             lw_solix TYPE solix,
             lv_filename TYPE string,
             lv_content_id TYPE string,
             lv_content_type TYPE w3conttype,
             lv_obj_len TYPE so_obj_len,
             lv_bmp TYPE so_fileext VALUE 'BMP',
             lv_description TYPE so_obj_des VALUE 'Graphic in BMP format',
             lc_doc_bcs TYPE REF TO cl_document_bcs,
             lc_bcs TYPE REF TO cl_bcs,
             lc_send_exception TYPE REF TO cx_root,
             lw_adsmtp TYPE lty_adsmtp,
             lv_mail_address TYPE ad_smtpadr,
             lc_recipient TYPE REF TO if_recipient_bcs,
             lc_send_request TYPE REF TO cl_bcs,
             lv_sent_to_all TYPE os_boolean.
      DATA : v_language TYPE sflangu VALUE 'E',
             v_e_devtype TYPE rspoptype.
      v_form_name = 'ZTEST_EMAIL'.
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          formname           = v_form_name
        IMPORTING
          fm_name            = v_namef
        EXCEPTIONS
          no_form            = 1
          no_function_module = 2
          OTHERS             = 3.
      IF sy-subrc = 0.
       break mhusin.
      ENDIF.
    starting here. ***
    Set title for the output
      lv_subject = 'Smartforms.'.
    Set control parameters to "no dialog"
      lw_control_parameters-no_dialog = lc_true.
    IF lw_service_subject-code = lc_fm1.
    *--- To get output device type
      CALL FUNCTION 'SSF_GET_DEVICE_TYPE'
        EXPORTING
          i_language    = v_language
          i_application = 'SAPDEFAULT'
        IMPORTING
          e_devtype     = v_e_devtype.
      lw_output_options-tdprinter = v_e_devtype.
      lw_control_parameters-getotf = 'X'.
      IF sy-subrc = 0.
       break mhusin.
      ENDIF.
    Set output options
      lw_output_options-xsf        = lc_true.
      lw_output_options-xsfcmode   = lc_true.
      lw_output_options-xsfoutmode = 'A'.
      lw_output_options-xsfoutdev  = space.
      lw_output_options-xsfformat  = lc_true.
      lw_xsfparam_line-name  = lc_graphics.
      lw_xsfparam_line-value = lc_extract.
      APPEND lw_xsfparam_line TO lw_output_options-xsfpars.
      lw_xsfparam_line-name  = lc_graphics_directory.
      lw_xsfparam_line-value = lc_mygraphics.
      APPEND lw_xsfparam_line TO lw_output_options-xsfpars.
      lw_xsfparam_line-name  = lc_content_id.
      lw_xsfparam_line-value = lc_enable.
      APPEND lw_xsfparam_line TO lw_output_options-xsfpars.
    Get the smartform content
      CALL FUNCTION v_namef
        EXPORTING
          control_parameters   = lw_control_parameters
          output_options       = lw_output_options
    *pass other application specific parameters (eg order number, items ).
      IMPORTING
          job_output_info    = lw_job_output_info
      TABLES
          tt_tabh              = tt_tabh
          tt_tabb              = tt_tabb
          tt_tabf              = tt_tabf
      EXCEPTIONS
          formatting_error = 1
          internal_error   = 2
          send_error       = 3
          user_canceled    = 4
          OTHERS           = 5.
      IF sy-subrc = 0.
       break mhusin.
      ENDIF.
      lw_html_data  = lw_job_output_info-xmloutput-trfresult.
      lt_graphics[] = lw_job_output_info-xmloutput-xsfgr[].
      CLEAR lv_html_xstr.
      LOOP AT lw_html_data-content INTO lw_html_raw.
        CONCATENATE lv_html_xstr lw_html_raw INTO lv_html_xstr IN BYTE MODE.
      ENDLOOP.
      lv_html_xstr = lv_html_xstr(lw_html_data-length).
      CALL FUNCTION 'SCP_TRANSLATE_CHARS'
        EXPORTING
          inbuff       = lv_html_xstr
          incode       = lv_incode
          csubst       = lc_true
          substc_space = lc_true
        IMPORTING
          outbuff      = lv_html_str
          outused      = lv_html_len
        EXCEPTIONS
          OTHERS       = 1.
    *HACK THE HTML CODE GENERATED BY SMARTFORM TO MAKE THE
    *EXTERNAL IMAGES APPEAR AS <IMG> TAG IN HTML
      REPLACE ALL OCCURRENCES OF '<IMG' IN lv_html_str WITH '<IMG' IGNORING CASE.
      REPLACE ALL OCCURRENCES OF '/>' IN lv_html_str WITH '/>' IGNORING CASE.
      REPLACE ALL OCCURRENCES OF '</A>' IN lv_html_str WITH '' IGNORING CASE.
      REPLACE ALL OCCURRENCES OF '<' IN lv_html_str WITH '<' IGNORING CASE.
      REPLACE ALL OCCURRENCES OF '>' IN lv_html_str WITH '>' IGNORING CASE.
    CALL METHOD html_control - >load_mime_object
       EXPORTING
         object_id  = 'ZWN'
         object_url = 'ZWN.GIF'
       EXCEPTIONS
         OTHERS     = 1.
      REPLACE ALL OCCURRENCES OF lc_utf8 IN lv_html_str WITH lc_latin1.
    REPLACE ALL OCCURRENCES OF lc_utf8 IN lv_html_str WITH 'iso-8859-1'.
       break mhusin.
      lv_html_len = STRLEN( lv_html_str ).
      lv_offset = 0.
      lv_length = 255.
      WHILE lv_offset < lv_html_len.
        lv_diff = lv_html_len - lv_offset.
        IF lv_diff > lv_length.
          lw_soli-line = lv_html_str+lv_offset(lv_length).
        ELSE.
          lw_soli-line = lv_html_str+lv_offset(lv_diff).
        ENDIF.
        APPEND lw_soli TO lt_soli.
        ADD lv_length TO lv_offset.
      ENDWHILE.
      CREATE OBJECT lc_mime_helper.
      CALL METHOD lc_mime_helper->set_main_html
        EXPORTING
          content     = lt_soli
          filename    = lv_name
          description = lv_subject.
      LOOP AT lt_graphics INTO lw_graphics.
        CLEAR lv_xstr.
        LOOP AT lw_graphics-content INTO lw_raw.
          CONCATENATE lv_xstr lw_raw-line INTO lv_xstr IN BYTE MODE.
        ENDLOOP.
        lv_xstr = lv_xstr(lw_graphics-length).
        lv_offset = 0.
        lv_length = 255.
        CLEAR lt_solix[].
        WHILE lv_offset < lw_graphics-length.
          lv_diff = lw_graphics-length - lv_offset.
          IF lv_diff > lv_length.
            lw_solix-line = lv_xstr+lv_offset(lv_length).
          ELSE.
            lw_solix-line = lv_xstr+lv_offset(lv_diff).
          ENDIF.
          APPEND lw_solix TO lt_solix.
          ADD lv_length TO lv_offset.
        ENDWHILE.
        CONCATENATE lc_mygraphics lw_graphics-graphics text-001 INTO lv_filename.
        CONCATENATE lc_mygraphics lw_graphics-graphics text-001 INTO lv_content_id.
        lv_content_type = lw_graphics-httptype.
        lv_obj_len      = lw_graphics-length.
    *Add images to the email
        CALL METHOD lc_mime_helper->add_binary_part
          EXPORTING
            content      = lt_solix
            filename     = lv_filename
            extension    = lv_bmp
            description  = lv_description
            content_type = lv_content_type
            length       = lv_obj_len
            content_id   = lv_content_id.
      ENDLOOP.
      TRY.
          lv_subject = lv_subject.
          lc_doc_bcs = cl_document_bcs=>create_from_multirelated(
                   i_subject          = lv_subject
                   i_multirel_service = lc_mime_helper ).
        CATCH cx_document_bcs INTO lc_send_exception.
        CATCH cx_bcom_mime INTO lc_send_exception.
        CATCH cx_gbt_mime INTO lc_send_exception.
      ENDTRY.
    Create send request
      TRY.
          lc_bcs = cl_bcs=>create_persistent( ).
        CATCH cx_send_req_bcs INTO lc_send_exception.
      ENDTRY.
      TRY.
          lc_bcs->set_document( i_document = lc_doc_bcs ).
        CATCH cx_send_req_bcs INTO lc_send_exception.
      ENDTRY.
    Set-up email receiver
      lv_mail_address = '[email protected]'.
    TRANSLATE lv_mail_address TO UPPER CASE.
      TRY.
          lc_recipient = cl_cam_address_bcs=>create_internet_address(
              i_address_string = lv_mail_address ).
        CATCH cx_address_bcs INTO lc_send_exception.
      ENDTRY.
      TRY.
          lc_bcs->add_recipient( i_recipient = lc_recipient ).
        CATCH cx_send_req_bcs INTO lc_send_exception.
      ENDTRY.
    Send smartforms as HTML email
      TRY.
          lc_bcs->send( ).
        CATCH cx_send_req_bcs INTO lc_send_exception.
      ENDTRY.
      COMMIT WORK.
      WRITE:/ 'Mail sent'.
    ENDFORM.                    "call_smartforms
    End Code --->
    Thanks and Regards.

    1- put your images in a directory under the web app directory. Example: app/images/
    2- in your jsp, use: String file = application.getRealPath("/images/"); to get the images directory. See http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/ServletContext.html#getRealPath(java.lang.String)
    3- it's not the right forum to post this kind of question. Post them in the JSP/Servlet JSTL forum instead

  • How to display a image in webdynpro view using a bytearry

    Hi Frndz..
    How to display an image in a view using webdynpro java ..i have bytearry object in context ..like
    *byte[] img = wdContext.nodeYywwwdataImport_Input().nodeOutput().nodeOutMime().currentOutMimeElement().getLine();*_
    by using this i need to show image in view..
    Kindly help me ....
    Thankas in Advance
    Regards
    Rajesh

    Hi,
    byte[] img = wdContext.nodeYywwwdata_Import_Input().nodeOutput().nodeOutMime().currentOutMimeElement().getLine();
    use this code to create resource and you need to set this value to the context created to display the image suppose in the image UI and set the source property with this attribute:-
    IWDResource res=WDResourceFactory.createCachedResource(b,"MyImage",WDWebResourceType.JPG_IMAGE);
    IPrivateAppView.IVn_ImageTabElement imageEle=wdContext.createVn_ImageTabElement();
           imageEle .setVa_Name(res.toString());
    wdContext.nodeVn_ImageTab().addElement(imageEle);
    Hope this may help you.
    Deepak

  • How to Display an Image on my FORM

    Good Day!
    I would like to ask some help from you guys with my problem on how to display an image on my form. I would like to display my uploaded image on my form but instead of an image, the get_blob_file is showing. By the way, I'm using Apex 4.1
    I downloaded the Order Entry Sample Application and followed the Page 6, the Product Details. I even made snapshots of each details from Page Rendering to Page Processing in order not to miss a thing.
    At the moment, I was able to upload or store the image on my created Oracle table and also able to retrieve it on the Download Link Text with Content Disposition value of Inline, provided by APEX Settings. If I invoke the Download link beside the file browser, a page with the image will be shown, below is the address:
    http://127.0.0.1:8080/apex/apex_util.get_blob_file?a=200&s=339877802936975&p=230&d=7107921433296839&i=7107601420296838&p_pk1=54&p_pk2=&p_ck=7D6512D967336C4B94258EEA3CDF1BE6&p_content_disposition=inline
    However, instead of showing the image on a region, below is the one showing on my Form:
    <img src="apex_util.get_blob_file?a=200&s=339877802936975&p=230&d=7107921433296839&i=7107601420296838&p_pk1=54&p_pk2=&p_ck=7D6512D967336C4B94258EEA3CDF1BE6" />
    As you can see the parameter values are the same but I know I missed something that's why I'm here :)
    I would highly appreciate all the help you can provide and many thanks in advance.
    I tried to change gear by making an html region of type PL/SQL (anonymous block) and a procedure but still no image :(
    Below are the scripts.
    declare
    cursor cur is
    select *
    from wsemployee
    where empid = :P230_EMPID;
    begin
    for rec in cur
    loop
    IF rec.mime_type is not null or rec.mime_type != '' THEN
    htp.p( '<img src="my_image_display?p_image_id='||NVL(rec.empid,0)||'" height="'||100||'"/>' );
    else
    htp.p( 'No Image ');
    END IF;
    htp.p( ' ');
    end loop;
    end;
    PROCEDURE
    create or replace PROCEDURE my_image_display( p_image_id IN NUMBER)
    AS
    l_mime VARCHAR2 (255);
    l_length NUMBER;
    l_file_name VARCHAR2 (2000);
    lob_loc BLOB;
    BEGIN
    SELECT MIME_TYPE, PHOTO_BLOB_CONTENT, PHOTO_FILENAME,DBMS_LOB.GETLENGTH(photo_blob_content)
    INTO l_mime,lob_loc,l_file_name,l_length
    FROM wsemployee
    WHERE empid = p_image_id;
    -- set up HTTP header
    -- use an NVL around the mime type and
    -- if it is a null set it to application/octect
    -- application/octect may launch a download window from windows
    owa_util.mime_header( nvl(l_mime,'application/octet'), FALSE );
    -- set the size so the browser knows how much to download
    htp.p('Content-length: ' || l_length);
    -- the filename will be used by the browser if the users does a save as
    htp.p('Content-Disposition: attachment; filename="'||replace(replace(substr(l_file_name,instr(l_file_name,'/')+1),chr(10),null),chr(13),null)|| '"');
    -- close the headers
    owa_util.http_header_close;
    -- download the BLOB
    wpg_docload.download_file( Lob_loc );
    END my_image_display;
    Edited by: user13831927 on Dec 22, 2012 3:24 PM

    Hi Ying,
    you can add a UDF to the table spp2 with a programm
    but the table is not yet listed in the 'Manage User Fields' form.
    there's no way to "enable" it - sorry

  • How to display an Image which is on Panel behind JScrollPane - Please Help

    Hiii All,
    How to display an Image which is on Panel behind JScrollPane. I have set the setOpaque() method of JScrollPane to false still when i run the program the JScrollPane is set as Opaque.. Can some one please help me in this...
    Thanks,
    Piush

    you need to set both
    scrollPane.setOpaque(false);
    scrollPane.getViewport().setOpaque(false);

  • How to display an image if user does not have flash installed?

    Hi, Not all people have flash and the ones that don't will
    have an unpleasant experience on my website. How can I display an
    image instead of the flash itself for people that don't have flash
    who visit my website? I just have flash on the upper portion of the
    website. Please explain how I can do this! I haven't done flash in
    a long time so be simple! Thank you!

    In the site you can download the SWFObject1.5.
    It includes a javascript which is embeding the flashmovie
    with vallidaton.This swfobject.js can be used for any html.

  • How to display an image, which is stored in a database?

    Hi All,
    I would like to display an image with Web Dynpro.
    I already know how to display an image which is stored in the path src/mimes/Components/...
    But does anybody knows, how to display an image which is stored in a database (e.g. MaxDB)as a datatype of binary?
    Thanks in advance!
    Regards,
    Silvia

    Hallo John,
    yes, you can use the Image UI element.
    Further you have to create a String for the URL. Implement like as follows:
    IWDCachedWebResource cachedResource = null;
    String imgUrl = null;
    WDAttributeInfo attInfo = wdContext.getNodeInfo().getAttribute(IPrivateXYView.IXYElement.PIC_DB);
    IWDModifiableBinaryType binaryType =
                   (IWDModifiableBinaryType) attInfo.getModifiableSimpleType();
    binaryType.setMimeType(WDWebResourceType.JPG_IMAGE);//Example *.jpg
    WDWebResourceType type = binaryType.getMimeType();
    byte[] file = wdContext.currentXYElement().getPicDB();
    if (file != null)
    cachedResource = WDWebResource.getWebResource(file, type);
    try
    imgUrl = cachedResource.getURL();
    catch (WDURLException e)
    IWDMessageManager msgMgr = wdComponentAPI.getMessageManager();
                        msgMgr.reportException(e.getLocalizedMessage(), true);
    I hope it will help you.
    Regards,
    Silvia

  • How to display an image using MIDP on Palm?

    How can I display an image using MIDP on Palm? The following code works on the Siemens SL45i, but not on Palm:
    public class Test extends List
    Image image = Image.createImage("/images/test.png");
    append("item 1", image);

    Have found the exact same problem when trying to display an image (other then the default (null)) in a list, on a Palm.
    The image displays correctly on a form, but when set on an element in the list, it does not display. (mind you this is in both emulator mode and on the real device)
    It does not seem to be related to size of the image.
    The Sun documetation states, that you should not rely on it been displayed (obviously it's an implementation issue with the Palm, and other devices I have not tried)
    But like to hear definitively from Sun though!

Maybe you are looking for

  • My iPhone will not work.

    It won't turn on, charge, connect to iTunes. The connect to itunes sign pops up when I put it into recovery mode but then it will not restore on the computer. I went to the apple store and the guy thought trying to plug it into the computer and conne

  • Corrupted Bridge Program

    My previous download ofd Adobe Bridge CC (64bit) was corrupted when I experienced a computer crash. How do I download again to restore this program?

  • Image Watermark with a BC App?

    I know BC cannot apply a watermark automatically. However, I am wondering if this may be possible to create with a BC App? I have a client who will want to upload photos, have a watermark automatically applied, and go into the correct folder. My thou

  • Providing Oracle Database 10g Express Edition

    Hello, I would like to use Express Edition to develop a Internet Application. Before I start my work I have to find answers for the following questions. Are there any known Commercial Providers for hosting an Express Edition Environement? What do I h

  • Firefox keeps switching into Safe Mode, necessitating restart

    Firefox keeps switching into Safe Mode, necessitating Mac restart to get my extensions back. I'm fed up! -- I keep having to shut down umpteen apps to restart. Thanks for any insight, peter wilson (Montréal)