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 / August 2005

Tip: Looking for answers? Try searching our database.

Web application external reference

Thread view: 
DBoy001 - 24 Aug 2005 20:41 GMT
Hi all !

Is it possible, on the server side of a web application (JSP) to
reference files (JSPs, TLDs, HTML, etc.) that are located outside of
the application directory ?

I'd like to centralize some files that are reused among many
applications and I can't find a way to do it...

Thank you !
Roedy Green - 24 Aug 2005 20:48 GMT
>Is it possible, on the server side of a web application (JSP) to
>reference files (JSPs, TLDs, HTML, etc.) that are located outside of
>the application directory ?

What happens when you try?

That would be a clue to relaxing any restrictions.
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com

DBoy001 - 24 Aug 2005 21:37 GMT
Hmm.. I wasn't clear with my question...

I suppose I could reference the external files directly
(c:\commondir\commonfile.jsp) but that wouldn't be very portable and it
would be a pain to maintain...

So I'm wondering if there is a way (following best practices as much as
possible) to create a directory mapping which I could use as a
reference to the directory from all applications running on the same
server.

What I need is a clue of where to define such a mapping (JNDI, server
variable, config file ????).

Thanks !
Roedy Green - 25 Aug 2005 06:52 GMT
>What I need is a clue of where to define such a mapping (JNDI, server
>variable, config file ????).

That could be just a list of directory names or perhaps more
conveniently Files pointing to Dirs.

That could be just a little class of static finals.  If you want to
get fancy you could back it with a Properties file.

I am a big fan of using Java source itself for scripting rarely
changed configuration files.  You get excellent error checking,
extreme flexibility, computation and no parsers to write.
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com

Andrew Thompson - 25 Aug 2005 07:58 GMT
> Hmm.. I wasn't clear with my question...
>
[quoted text clipped - 4 lines]
> So I'm wondering if there is a way (following best practices as much as
> possible) to create a directory mapping

ServletContext.getRealPath("/");
ServletContext.getRealPath("/commondir/commonfile.jsp");

HTH

Signature

Andrew Thompson
physci.org 1point1c.org javasaver.com lensescapes.com athompson.info
"Get off your f**kin cross.  We need the f**kin space to nail the next fool
martyr."
Tool 'Eulogy'



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.