Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: JavaJSPstruts
Hello Everyone,
 
I'm just a newbie with struts and I want to display an image onto JSP pages, but I can't make it display the image.
 
I tried to put the folder contain the images in "Web Content" folder but it didn't work and I tried to put it in "WEB-INF" folder, but it still didn't work.
 
Could anyone help me please?
 
This is the image tag i put in JSP page.
<img alt="logo" src="/resources/images/header.jpg"/>
 
Thanks for any comment
CK
Posted 12-Dec-11 22:20pm
Edited 13-Dec-11 0:20am
v3
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Thank you so much for any comment
I solved it by myself
This is the solution
In the jsp file of struts i have to have this directive to use html tag lib and in the "img" tag i should use rewrite attribute to link to the image file. And the image you should put in the Web Content path
 
And this is the jsp file in struts

<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
 
<img alt="logo" src="<html:rewrite page='/resources/images/header.jpg'/>" width="100%" height="20%"/>
  Permalink  
v3
Comments
NikulDarji at 14-Dec-11 0:35am
   
nice....:)
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
Comments
nguyenle.it at 13-Dec-11 9:33am
   
Thanks for your comment, but i mean i can't display image on jsp page, could you help me please?
Nagy Vilmos at 13-Dec-11 10:53am
   
Read the links you've been given. Now, what don't you understand?
RaviRanjankr at 13-Dec-11 16:12pm
   
Nice link, My 5!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 462
1 sanket saxena 355
2 OriginalGriff 235
3 Abhinav S 233
4 CPallini 205
0 Sergey Alexandrovich Kryukov 8,784
1 OriginalGriff 5,025
2 Peter Leow 3,839
3 Maciej Los 3,535
4 Er. Puneet Goel 3,107


Advertise | Privacy | Mobile
Web02 | 2.8.140415.2 | Last Updated 13 Dec 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid