Some time we need to know the directory in which our web-app is running.In servlet this can be done using following code.
String webAppPath = req.getSession().getServletContext().getRealPath("//");
This is useful when you need to generate some file for other application.
No comments:
Post a Comment