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 / March 2007

Tip: Looking for answers? Try searching our database.

Servlet spec 2.4 doesn't know context path and initialization time???

Thread view: 
Kimba - 28 Mar 2007 18:50 GMT
Hi everyone,

I have the following problem:

My web application is loading a Servlet on start-up. This servlet
initializes the web-application's environment inside the
init(ServletConfig config) method. Now, at this point in time I'd like
to dynamically get the web-app's context path. Unfortunately the
ServletContext doesn't have the getContextPath() method in servlet
specification 2.4 only in 2.5. And since the init(...) method doesn't
have a HttpServletRequest I have no chance of retrieving the servlet's
context path at initialization time??

Any suggestions on that??

Thanks,

Steffen
Arne Vajhøj - 29 Mar 2007 01:53 GMT
> My web application is loading a Servlet on start-up. This servlet
> initializes the web-application's environment inside the
[quoted text clipped - 6 lines]
>
> Any suggestions on that??

ctx.getServletContextName()

or

ctx.getRealPath("/")

maybe.

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



©2008 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.