users@glassfish.java.net

Re: using default web module with static content in docroot

From: <Jan.Luehe_at_Sun.COM>
Date: Wed, 15 Aug 2007 13:19:50 -0700

Bob Treacy wrote:

>Did you clear your browser cache?
>
>

Yes, I did.

Can you enable access logging (which is turned
off by default in the developer profile, in case you
are using that) to see which request URL is failing?

You can enable access logging with this command:

  asadmin set server.http-service.property.accessLoggingEnabled=true

Thanks,


Jan

>This is happening both on my local Mac development
>machine and my Linux production system.
>
>--- Jan.Luehe_at_Sun.COM wrote:
>
>
>
>>Bob,
>>
>>Bob Treacy wrote:
>>
>>
>>
>>>1. Make a simple webapp with this index.jsp
>>>
>>><%_at_page contentType="text/html"%>
>>><%_at_page pageEncoding="UTF-8"%>
>>>
>>><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
>>>Transitional//EN"
>>> "http://www.w3.org/TR/html4/loose.dtd">
>>>
>>><html>
>>> <head>
>>> <meta http-equiv="Content-Type"
>>>content="text/html; charset=UTF-8">
>>> <title>JSP Page</title>
>>> </head>
>>> <body>
>>>
>>>
>>> <img src="/mit-hmdc.banner.gif" />
>>>
>>> <h1>JSP Page</h1>
>>>
>>>
>>> </body>
>>></html>
>>>
>>>2. Put any gif in docroot and rename it
>>>"mit-hmdc.banner.gif" or else just change the <img
>>>
>>>
>>src
>>
>>
>>>... /> code above for your image file name
>>>3. Make sure there is no default web module
>>>configured. In the GlassFish console go to
>>>Configuration->Http Service->Virtual
>>>
>>>
>>Servers->server
>>
>>
>>>Default Web Module should be blank
>>>4. Browse to you webapp, you should see your image
>>>5.Go back in the admin console to
>>>Configuration->Http Service->Virtual
>>>
>>>
>>Servers->server
>>
>>
>>>Set Default Web Module to be your webapp
>>>6. CLEAR YOUR BROWSER CACHE -so the image isn't
>>>
>>>
>>loaded
>>>from your cache
>>
>>
>>>7. Browse to your webapp. The image is broken
>>>
>>>
>>>
>>>
>>Hmm, this seems to be working fine for me:
>>
>>After declaring my webapp to be the default webapp
>>of the virtual server "server", the image gets
>>served
>>both when I access the webapp's JSP at the virtual
>>server's root context:
>>
>> http://<host>:<port>/<jsp>
>>
>>as well as when I access it at the webapp's context
>>root:
>>
>> http://<host>:<port>/<webapp>/<jsp>
>>
>>
>>Jan
>>
>>
>>
>>
>>>--- Jan.Luehe_at_Sun.COM wrote:
>>>
>>>
>>>
>>>
>>>
>>>>Bob Treacy wrote:
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>After I configured the virtual server to default
>>>>>
>>>>>
>>to
>>
>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>my
>>>>
>>>>
>>>>
>>>>
>>>>>webapp, the images on our banners (which are
>>>>>
>>>>>
>>stored
>>
>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>in
>>>>
>>>>
>>>>
>>>>
>>>>>docroot/images) are broken. Is there a way to fix
>>>>>this?
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>Can you please provide a reproducible test case?
>>>>
>>>>Jan
>>>>
>>>>
>>>>
>>>>
>>>>
>>>---------------------------------------------------------------------
>>>
>>>
>>>>
>>>>
>>>>
>>>>
>>>>>To unsubscribe, e-mail:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>users-unsubscribe_at_glassfish.dev.java.net
>>>>
>>>>
>>>>
>>>>
>>>>>For additional commands, e-mail:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>users-help_at_glassfish.dev.java.net
>>>>
>>>>
>>>>
>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>>
>>---------------------------------------------------------------------
>>
>>
>>>
>>>
>>>
>>>
>>>>To unsubscribe, e-mail:
>>>>users-unsubscribe_at_glassfish.dev.java.net
>>>>For additional commands, e-mail:
>>>>users-help_at_glassfish.dev.java.net
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>---------------------------------------------------------------------
>>
>>
>>>To unsubscribe, e-mail:
>>>
>>>
>>users-unsubscribe_at_glassfish.dev.java.net
>>
>>
>>>For additional commands, e-mail:
>>>
>>>
>>users-help_at_glassfish.dev.java.net
>>
>>
>>>
>>>
>>>
>>>
>>
>>
>---------------------------------------------------------------------
>
>
>>To unsubscribe, e-mail:
>>users-unsubscribe_at_glassfish.dev.java.net
>>For additional commands, e-mail:
>>users-help_at_glassfish.dev.java.net
>>
>>
>>
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>
>