cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

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

Former Member
0 Kudos

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>

Former Member
0 Kudos

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

Former Member
0 Kudos

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,

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.