This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Regarding Include directive element

 
karthikeyan piramanayagam
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,

Is it possible to include a "gif" file in a JSP page

I have used the following syntax:

<%@ include file="feather.gif" %>

But im not getting the output. Is there any way to include an image in our JSP file?

Plz help me as soon as possible

Regards...
P.karthikeyan
 
Kj Reddy
Ranch Hand
Posts: 1704
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use img html tag to include gif. The syntax looks like this:

<img src="feather.gif">
 
karthikeyan piramanayagam
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, still im not getting it. Actually its not like servlet,Jsp, its something like jetspeed,one of the tool to develope websites. Its a different frame work, so using img i dint get it. Do u know any other way using JSP

Regards...
P.karthikeyan
 
Kj Reddy
Ranch Hand
Posts: 1704
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
do not know aboout jet speed..

you can try this but not sure it will work
out.print("<img src='feather.gif'>");
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The right way to put an image in a page is with the <img ..> tag.
If it's not working, it is most likely due to the path, listed in the src attribute, being wrong.

Where is your image file and what are you entering for the src attribute?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic