Servlet spec 2.4 doesn't know context path and initialization time???
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
.
Relevant Pages
- Re: jsp - I feel like an ass!
... was something else instead of myapp it might have been clearer eg ... if the web application has a context path ... there is no reason to use a servlet mapping URL pattern ... belong to a package, of course, as has been said twice now. ... (comp.lang.java.programmer) - Re: Servlet spec 2.4 doesnt know context path and initialization time???
... initializes the web-application's environment inside the ... init(ServletConfig config) method. ... to dynamically get the web-app's context path. ... ServletContext doesn't have the getContextPathmethod in servlet ... (comp.lang.java.programmer) - Re: How to get the contextPath in a servlets init-method?
... because the same servlet may be accessible via more than one ... The context path is partly a function of the request, ... why it is only available from the request object. ... this information at init time, ... (comp.lang.java.programmer) - Re: servlet forwarding by name WITHOUT modifying web.xml
... WebSphere Application Server has the ability to "serve servlet by classname" ... On the other hand, do you know Struts? ... add Actions configured in a Struts config xml file. ... Struts Action base class). ... (comp.lang.java.programmer) - Re: Multiple Identical Servlets
... IMHO a superior approach would be to map the servlet to multiple paths ... That would necessitate having the config file be re-read each time the ... wondering what the proper solution is. ... (comp.lang.java.programmer) |
|