• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jsp static include - no joy

 
B Chandler
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey guys,

wonder if you can help with this small problem...

trying to include a jspf frag in my main jsp (as a header), but it doesn't appear.

In my web-app structure, I have placed files in the following places:-

The jspf fragment (header) -> Gallery/WebRoot/WEB-INF/jspf/Header.jspf

The image called by the fragment -> Gallery/WebRoot/images/logo.gif

The main jsp that is trying to include the fragment ->
Gallery/WebRoot/jsp/adminForm.jsp


When I preview the header fragment in the IDE, the logo and text appear as intended, so I'm happy that the frag can find the logo.gif.
But the problem occurs when I use:



in the body of the main jsp. IDE shows no errors but the header content fails to materialise.

Does anyone know where I went wrong?
I read that frag files should be kept under WEB-INF/jspf and I know that files under WEB-INF can't be accessed directly, but it shouldn't affect internal access, should it?!

regards,
B

[ April 13, 2005: Message edited by: B Chandler ]
[ April 13, 2005: Message edited by: B Chandler ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you try:

?
 
B Chandler
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ben,

I tried your suggestion.... no errors (that's good), but still no header content I'm afraid.

I thought I'd need to walk up a directory from the location of the jsp?

I used:

in the frag file in order to locate logo.gif and don't understand why the same principle doesn't allow the jsp to locate header.jspf.

This is my first attempt at JSP and I'm also new to the myEclipse IDE so I can't rule out general config error.
B
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you right clicked on the images and read the properties to see where the browser is looking for them?

Remember they're going to be relative to the URL that shows up in the browser's address window, not where the include lives.
The browser doesn't know anything about server side includes.

<img src="images/myImage.gif" />
 
B Chandler
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ben,

good point, well put!

We're up and running now, cheers mate

regards, B
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic