Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Apache Tomcat »

getting absolute path to web application and making syntetic ServletRequest & ServletResponse

sed

2007-02-15


Hi,

Is it possible to get path to web-application of the servlet in
servlet's init method? The path should be in form
http://[host]:8080/[context]/.
When I invoke context.getResource("/"), I have "jndi:/localhost/mat/",
but I need "http://localhost:8080/mat/".

In fact I need make http request from servlet's init method to one
page of the same web application, but I don't know there the absolute
path to it.

Maybe it is possible to make this request using
RequestDispatcher.include(ServletRequest, ServletResponse), but how
can I create synthetic request and response from passing to include
method?

---------------------------------------------------------------------
To start a new topic, e-mail: users@(protected)
To unsubscribe, e-mail: users-unsubscribe@(protected)
For additional commands, e-mail: users-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.