Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

how to display images in JSP

Hi all,

I created a Jsp page and I stored my images in the dist-->images folder and by using the following code

<% String image = componentRequest.getWebResourcePath() + "/images/image.gif"; %>

<img src="<%=image%>">

I try to display the images in that page.

Yes I am successful in displaying one image.

But my problem here is to display more than two images which are present in that page.

Can any body help me regarding this.

Your help will be highly rewarded with points.

Regards,

Ramana.

replied

Hi Ramana,

You can give more than one img tag in a JSP page.

Try this..

<% String image = componentRequest.getWebResourcePath() + "/images/image.gif"; %>

<img src="<%=image%>">

<% String image2 = componentRequest.getWebResourcePath() + "/images/image2.gif"; %>

<img src="<%=image2%>">

Also, you can set the height, width and border for an image as

<img src="<%=image%>" WIDTH="300" HEIGHT="300" ALIGN="BOTTOM" BORDER="0">

Regards,

Uma

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question