Showing posts with label servlet. Show all posts
Showing posts with label servlet. Show all posts

Wednesday, March 2, 2011

Getting context path in serlvets

if (servletContext.getMajorVersion() == 2
&& servletContext.getMinorVersion() <= 4) {
return servletContext.getServletContextName();
} else {
return servletContext.getContextPath();
}