• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem of display image in tiles

 
Alvin chew
Ranch Hand
Posts: 834
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, i have a problem , which i could not display the image file in my body.jsp , it actually include css

body code :

it display the form but not include the image file which is "gif" type...but it exist in the folder ..

can anyone plese guide ? it work fine in jsp , but if connect to tiles, it doesn't show image...

[ August 05, 2004: Message edited by: Alvin chew ]

[ August 05, 2004: Message edited by: Alvin chew ]
[ August 06, 2004: Message edited by: Alvin chew ]
 
failed failed
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The JSP file is executed relative to the servlet path:

http://www,mysite.com/servlet/fred.do/images/image.gif

(for example)
The actual path could be pointing somewhere different.

Try putting <html:base/> at the top of the JSP file; that's what I usually do.
[ August 05, 2004: Message edited by: failed failed ]
 
Alvin chew
Ranch Hand
Posts: 834
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, do you mind to show me some sample? i couldn't get u , i'm very new to struts ...thank you !
 
Leandro Melo
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Suppose you have something like this.

+WEBModule
 +Pages
  -myPage.jsp
 +Images
  - myFig.jsp

In this case you should use a slash ("/") just before the path.

Try this to see if it works.

url(/images/bars2.gif)

[ August 06, 2004: Message edited by: Leandro Melo ]
[ August 06, 2004: Message edited by: Leandro Melo ]
 
Alvin chew
Ranch Hand
Posts: 834
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, leandro, it doesn't work, for my cASE,

my folder structure,

- web-inf\testtiles for holding the file of tiles,
- web-inf\testtiles\images for holding images

is url(/images/bars2.gif) still valid to my case ?

thank you !
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic