Results 1 to 5 of 5
- 12-31-2008, 07:36 PM #1
Member
- Join Date
- Dec 2008
- Posts
- 4
- Rep Power
- 0
Eclipse can't find my image file when generating HTML
Hi all,
I'm trying to reference an image in a Java web project using the following code:
orJava Code:out.println("<img src=\"test.jpg\">");
However, no matter where I try placing the test.jpg file, I just can't seem to reference it as I get a broken image. Here are a few of the places I've tried placing it:Java Code:out.println("<img src=\"resources/test.jpg\">");
- Directory (the project)
- Directory > resources
- Directory > WebContent
- Directory > WebContent > resources
Am I doing something wrong? If I manually try referencing the image from a browser, I just get the same main project page again:
I'm working with Eclipse 3.4.1 and using XAMPP + Tomcat in a Windows XP Pro SP3 environment. The Java project I'm working on works just fine, but I just cannot seem to find out how to reference external images or other files (CSS, XSL, etc).Java Code:ocalhost:8080/Directory/test.jpg
Any help would really be appreciated! I'm a PHP developer by trade, so this is fairly frustrating.
Thanks,
- Matt
- 01-07-2009, 11:50 PM #2
Member
- Join Date
- Dec 2008
- Posts
- 4
- Rep Power
- 0
Anyone? :-(
- 01-08-2009, 01:04 AM #3
Display jpg
Does this help?
Simplest way to read and display a jpeg image
Luck,
CJSLChris S.
Difficult? This is Mission Impossible, not Mission Difficult. Difficult should be easy.
- 01-08-2009, 02:01 AM #4
Member
- Join Date
- Dec 2008
- Posts
- 4
- Rep Power
- 0
Thanks, but what about if I'm just trying to display the image via generated HTML, such as via XSLT through the Saxon library?
- 01-08-2009, 10:26 PM #5
Member
- Join Date
- Dec 2008
- Posts
- 4
- Rep Power
- 0
Similar Threads
-
How can I include a html file in html textarea?
By surya_dks in forum New To JavaReplies: 2Last Post: 10-04-2008, 07:20 AM -
To open an image file such as Jpeg file using JAva Program
By itmani2020 in forum Advanced JavaReplies: 10Last Post: 07-11-2008, 09:57 AM -
Generating Javadoc In Eclipse IDE
By JavaForums in forum EclipseReplies: 0Last Post: 05-22-2007, 09:34 PM -
Generating Code Automatically Using Custom code Template In Eclipse
By JavaForums in forum EclipseReplies: 1Last Post: 04-26-2007, 03:52 PM -
Using Find And Replace In Eclipse IDE
By JavaForums in forum EclipseReplies: 0Last Post: 04-26-2007, 10:15 AM


LinkBack URL
About LinkBacks

Bookmarks