Hi all,
I am using java bean class in my web application(it is not extending servlet).My need is to get the context path of the application in that class.If yes how.
I am using "./".It doesn't work. Please help me

Recommended Answers

All 2 Replies

this.getClass().getProtectionDomain().getCodeSource()

see the API docs for Class and ProtectionDomain and experiment a bit.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.