Hi,

>try just:
><img src="images/close.gif">

Yup, or ../images/, but not /images.  For HTML references, / means the
server root, not the root of your webapp, and is usually a wrong choice.
Even when it works, you still limit portability by hard-coding your
webapp to context path "".

Yoav

>
>
>
>
>On Sun, 2004-10-17 at 20:49, andy davidson wrote:
>> Hi
>>
>> I have a simple sevlet that generates <img>. I can not
>> get the images to load? I read the "servlet essential"
>> tutorial at sun.com, but that did not help. To try to
>> figure what was going on I turned on the dumper. Here
>> is my file layout
>>
>> webapps/MyBookmarks/images/*.gif
>> webapps/MyBookmarks/WEB-INF/web.xml
>> webapps/MyBookmarks/WEB-
>INF/classes/com/.../MyBookmarks/MyBookmarksServlet.class
>>
>> http://localhost:8080/MyBookmarks runs my servlet as
>> expected
>>
>> looking at the output of the dump, I see
>> request URI = /MyBookmarks
>> servletPath=/
>> status=200
>>
>> my servlet generates two tags as follows neither of
>> these work. (I have tried many other ways)
>>
>> <img src="MyBookmarks/images/close.gif">
>>
>> dump output
>> request URI=/MyBookmarks/images/close.gif
>> contextpath=/MyBookmarks
>> header=refer=http://localhost:8080/MyBookmarks
>> servletPath=/images/close.gif
>> status=200
>> method=get
>> pathinfo=null
>>
>> status=200?? the image did not load! I even hit the
>> reload button on my web browser
>>
>> <img src="/images/open.gif">
>> dump output
>> request URI=/images/openFolder.gif
>> contextPath=
>> servletpath=/images/close.gif
>> status=400
>>
>>
>> here is my web.xml file
>>
>> web-app>
>>     <servlet>
>>         <servlet-name>MyBookmarks</servlet-name>
>>
>> <servlet-
>class>com.sharkBiteRight.MyBookmarks.MyBookmarksServlet</servlet-class>
>>     </servlet>
>>
>>     <servlet-mapping>
>>         <servlet-name>MyBookmarks</servlet-name>
>>         <!--
>> http://localhost:8080/MyBookmarks/MyBookmarks works
>>              <url-pattern>/MyBookmarks</url-pattern>
>>         -->
>>
>>         <!-- http://localhost:8080/MyBookmarks works
>> -->
>>              <url-pattern>/</url-pattern>
>>     </servlet-mapping>
>> </web-app>
>>
>> thanks in advance
>>
>> andy
>>
>>
>>
>>
>> __________________________________
>> Do you Yahoo!?
>> Yahoo! Mail - Helps protect you from nasty viruses.
>> http://promotions.yahoo.com/new_mail
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to