Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2007

Tip: Looking for answers? Try searching our database.

Accessing image files from several web application contexts

Thread view: 
jstorta - 17 Nov 2007 21:31 GMT
I have a few Java web applications that I am currently working on
using JavaServer Faces.

Each of these applications needs to access the same group of image
files.  I do not want to have to provide and maintain separate copies
of the image files for each web app.  Nor do I want to have to put all
of the images files in the WARs each time I deploy the apps.

I want to be able to put the image files in a central place on the
server and at runtime allow each web application to access them as
needed.  This central location would be inaccessible unless you went
through the web application.

For example.
I would store the images in a file system called
/web/images

The web applications, myapp1 & myapp2, would be located in
/web/apps/myapp1
/web/apps/myapp2

I have setup JNDI database connection pools and used those to access
common databases from multiple apps.  What I need would be similar,
but instead of a database it would just be some directories and
files.  And I do not need just the data, but I need to be able to
actually display the image on a web page generated by JSF.

A push in the right direction would be appreciated.

Thanks.
Arne Vajhøj - 18 Nov 2007 01:59 GMT
> I have a few Java web applications that I am currently working on
> using JavaServer Faces.
[quoted text clipped - 24 lines]
>
> A push in the right direction would be appreciated.

We can not do miracles.

If you do not need the security it is easy to put them in
a central place (you may actually get slightly better performance
by having them served by Apache than by Tomcat).

If you need the security then you need to get Tomcat involved.

If your setup allow single signon to all web apps, then you
simply create a new web app with graphics and protect that web
app but allow all users access.

If your setup requires indidual login per web app, then you
should put the grapgics in a dir that is not served by Tomcat,
but is accessible by Tomcat and then add a graphics serving
servlet to all web apps and stream the graphics file via that
(/app/GraphicsServlet?img=foobar.gif).

If your file system allows directory linking you may be able
to link the graphics dir into the web apps that need it.

Not a solution, but some ideas to work with. Maybe other have
better ideas.

Arne


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.