users@glassfish.java.net

RE: Serving static content

From: Martin Gainty <mgainty_at_hotmail.com>
Date: Mon, 11 Mar 2013 19:55:06 -0400

you were 95% of the way there! domains\main_domain\config\server.policy grant codeBase "file:./jsps/-"{
    permission java.io.FilePermission "/apache/htdocs/jpgs/*.jpg", "read";} tweak the jsps folder to actual folder location of jsps
tweak the jpgs folder to actual folder location of jpgs

Martin Gainty
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.

> To: users_at_glassfish.java.net
> Subject: Serving static content
> From: forums_at_java.net
> Date: Mon, 11 Mar 2013 13:16:31 -0500
>
> I'm developing a website with many pages. Most of these pages are static
> content, but I am also writing a servlet to handle some user queries. At the
> moment, most of the website is being developed by a team independently of the
> servlet. My servlet will generate HTML web pages which need to include tags
> which reference .jpgs in the main website. Right now I have a copy of the
> static website on my harddrive. However, when I test my servlet, none of the
> images I link to a displayed. The HTML I generate looks like: While this
> displays correctly if I save the page to a file and then load the file in a
> web browser, no images display when the same page is served to the same web
> browser by GlassFish. I suspect GlassFish is refusing to resolve anything
> starting with file:// for security reasons. Anyhow, how can I test out my
> servlet? I'd like to be able to have links that can display images from the
> static website files on my hard drive.
>
> --
>
> [Message sent by forum member 'kitfox']
>
> View Post: http://forums.java.net/node/895596
>
>