Skip to Content
author's profile photo Former Member
Former Member

Calling images stored in the "images" folder of the PAR file

Hi all,

I want to show a .GIF file which i have stored in the "/images" folder of my PAR file. I am developing a JSP in which i am using <IMG SRC= ""> tag to display it.

But it does not show me the image if i use the following:-

/images/xyz.GIF

images/xyz.GIF

xyz.GIF

Please help me in this.

Regards,

Narahari

Add a comment
10|10000 characters needed characters exceeded

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Sep 29, 2005 at 11:47 AM

    HI

    Try with this code

    String path = request.getResource(IResource.IMAGE,"images/ABC.gif").getResourceInformation().getURL(request);

    response.write("<img src = "path"/>");

    Regards

    Rajeev.

    Do award points for helpful answers.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 29, 2005 at 12:12 PM

    Hi Narahari,

    I prefer to avoid working with JSP and develop mainly with DynPages but perhaps the code that I use there will help you. I'll generaly use something like;

    String picPath = request.getWebResourcePath() + "/images/xyz.gif";

    where my image folder is in the dist folder of the par.

    I hope this helps,

    Patrick.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 29, 2005 at 02:15 PM

    Try this:

    Place myImage.gif in Images folder.

    JSP:

    <%@ taglib uri="tagLib" prefix="hbj" %>
    <% String image1 = componentRequest.getWebResourcePath() + "/images/myImage.gif"; %>
    
    <hbj:content id="myContext" >
      <hbj:page title="PageTitle">
       <hbj:form id="myFormId" >
         
             <img src="<%=image1%>">
          
         </hbj:form>
      </hbj:page>
    </hbj:content>

    Regards,

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 30, 2005 at 03:14 AM

    Hi,

    Try this code:

    <i>

    <%@ taglib uri= "tagLib" prefix="hbj" %>

    <hbj:content

    id="myContext">

    <hbj:page

    title="PageTitle">

    <center>

    <hbj:form

    id="myFormId">

    <% String ImageURL = componentRequest.getWebResourcePath() + "/images/xyz.GIF"; %>

    <hbj:image

    id="Logo"

    width="608"

    height="89"

    src="<%=ImageURL%>"

    alt="xyz.GIF" />

    </hbj:form>

    </center>

    </hbj:page>

    </hbj:content></i>

    Rgds,

    Raj

    <b>PS: Please Consider rewarding points.</b>

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      hi All,

      I've similar application only difference being in the images folder, there is list of images say

      image0.jpg

      image1.jpg

      image2.jpg and so on.

      now I have used the following code:

      <% String ImageURL = componentRequest.getWebResourcePath() + "/images/xyz.GIF"; %>

      src="<%=ImageURL%>"

      Now I want to randomly pick any of the images. How to go about this.

      Thanks in advance.

      Srikant

  • author's profile photo Former Member
    Former Member
    Posted on Sep 30, 2005 at 07:05 AM

    1. You have to determine the path, as the prvious posters mentioned

    2. you must not place the images within the PAR-INF-directory, since these contents can not be read via normal urls. Place your images directory in the directory of your par-inf-dir

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.