Hi Friends,
I'm new to web application development.
I'm doing web based project in eclipse.... Displaying the images on jsp page.
My directory Structure in eclipse...
Maybe you didn't update your build script, so it still copies the images directly to webContent. Try to enter the original path (should look something like http://myserver/mywebapp/logo.png) as an URL in your browser, and see if the images show up? Then try the same with your new path.
Image references are always relative to the location of the JSP that generated the HTML. So if the JSP is in webcontent, then an will find images in webcontent/img, but if you move the JSP to a subdirectory, then you need to switch the image reference to .
Image URLs, along with all other resource URLs in a JSP should be server-relative URLs that begin with the context path. See the JspFaq for more details.
Peter Johnson wrote:Image references are always relative to the location of the JSP that generated the HTML. So if the JSP is in webcontent, then an will find images in webcontent/img, but if you move the JSP to a subdirectory, then you need to switch the image reference to .
It's working... Thanks Peter.
Can you please tell me how can i get the root path for my WebContain directory.
I'm doing project using struts 2 and hibernate 3.6.
Thanks again.