How do I find the webapp name from within a context without changingweb.xml?

C

christopher

We are planning to run numerous parallel webapps which access
different resource bundles. Some resources are in files specific to
the webapp, which are currently inside the webapp directory tree. My
thought is to break these files out into a parallel tree so I can jar
up all the class and jsp files and deploy a generic war that is the
same for every app. This would be easy if I can get the webapp name,
but that seems to be hidden. Tomcat 6 BTW

I have seen a solution where I run a system process like pwd (unix)
which will work if there is no Java solution.

BTW the app starts when the context reloads so I cannot wait for a URL
to pick up the webapp name, and for the same reason
ServletContext.getRealPath() is no go.

Thanx!
 
C

christopher

stupid me
context.getRealPath("/") works fine. I thought it needed a full URL
per the example.
Haha -- I always post after an hour of looking, instead of 64.5
minutes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top