[Logo] Enterprise Client Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
WebApp Directory  XML
Forum Index -> Development
Author Message
kabat

Power User

Joined: 10/12/2007 10:12:44
Messages: 78
Offline

Hi,

is there a possibility to receive the path of the root directory of the web application?
Like Params.getCISDirectoryName() within CIS.

Thanks, Agnes
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5520
Offline

Well, there is a way: ServletContext.getRealPath(). BUT: this method is not supported by all servelt containers, but only by these ones which extract WAR files to the file system (as Tomcat). It is very dangerous to e.g. do write-access to the web application directory for clustered scenarios.

If the background of your question is, to write files which can be later on accessed by a URL...: then your application will not operate smoothly in a clustered application server environment. (The session might migrate from one server to the next...).

Björn

Björn Müller, CaptainCasa GmbH
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team