Reputation: 3
I have a question because of the context of my application.
I work currently on a project and I need the current context URL from my web application to call another application? If possible without HTTP Request. I need this because I use different Tomcats and environments for this application. I don't like hard coding paths in properties or java code.
Upvotes: 0
Views: 437
Reputation: 1108722
It's since Servlet 2.5 (e.g. Tomcat 6 and newer) also available by ServletContext#getContextPath()
.
Upvotes: 0
Reputation: 804
How about a sendRedirect in the HTTPServletResponse? Once you're done with your first request, your servlet is going to tell the client to go and call your "other application".
Upvotes: 1