You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Thorsten Scherler <th...@juntadeandalucia.es> on 2009/03/02 09:26:18 UTC

[users@httpd] Reading images from a jar

Hi all, 

we have developed a block to add a new section to our page.

http://juntadeandalucia.es/28f2009/index.html

This section is independent from the rest of the portal. Since we are
using Apache httpd to serve all images, css and js we had to implement a
rewrite rule to the work dir of tomcat (our application is a j2ee app).

Something like:
RewriteRule "^/themes/images/28f2009/(.*)\.(gif|jpg|jpeg|ico)$"
"$PORTAL/work/blocks/conectorEspeciales/themer/themes/common/images/$1.$2" [L]

We cannot do this anymore out of constraints from our production
department and are looking into ways to link to the resources in the
block lib not pointing into the work dir of tomcat. 

Can I link into a jar via httpd directly?

I mean can I use something like 
RewriteRule "^/themes/images/28f2009/(.*)\.(gif|jpg|jpeg|ico)$"
"$PORTAL/WEB-INF/lib/conectorEspeciales.jar:/themer/themes/common/images/$1.$2" [L]

Any ideas and thoughts welcome.

TIA

salu2
-- 
Thorsten Scherler <thorsten.at.apache.org>
Open Source Java <consulting, training and solutions>

Sociedad Andaluza para el Desarrollo de la Sociedad 
de la Información, S.A.U. (SADESI)





---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Reading images from a jar

Posted by Thorsten Scherler <th...@juntadeandalucia.es>.
On Mon, 2009-03-02 at 10:59 +0100, Krist van Besien wrote:
> You cannot have apache serve files inside a jar. (A jar is a
> compressed archive, after all).

Hmm, yeah, I hoped it could.

> What I would do in your case is extract the static content from your
> webapp, and deploy it to your apache webroot seperately. Using aliases
> or rewrites to make requests for this content map to your static files
> in stead of your tomcat instance is than relatively straightforward.

Yeah, that definitely will work. 

salu2

> Krist
-- 
Thorsten Scherler <thorsten.at.apache.org>
Open Source Java <consulting, training and solutions>

Sociedad Andaluza para el Desarrollo de la Sociedad 
de la Información, S.A.U. (SADESI)





---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Reading images from a jar

Posted by Krist van Besien <kr...@gmail.com>.
On Mon, Mar 2, 2009 at 9:26 AM, Thorsten Scherler
<th...@juntadeandalucia.es> wrote:

> Can I link into a jar via httpd directly?

You cannot have apache serve files inside a jar. (A jar is a
compressed archive, after all).

What I would do in your case is extract the static content from your
webapp, and deploy it to your apache webroot seperately. Using aliases
or rewrites to make requests for this content map to your static files
in stead of your tomcat instance is than relatively straightforward.

Krist



-- 
krist.vanbesien@gmail.com
krist@vanbesien.org
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org