We can use below code snippet to get the servlet information in a servlet through servlet context object.
getServletContext().getServerInfo()