on 09-29-2005 12:41 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.