The servlet is a Java programming language class used to extend the capabilities of a server. Although servlets can respond to any types of requests, they are commonly used to extend the applications hosted by web servers, so they can be thought of as Java applets that run on servers instead of in web browsers.
The need to install Servlets is when you wish to use .jsp pages on your web hosting account. You can use the .jsp pages on the server which has Java, Apache/Tomcat installed.
Installing Servelts is possible when you have root access to your server. Login to your WHM as root & access option Account Functions » Install Servlets. Select the domain which should support .jsp pages & click on Install.
An other alternative is to install it from the command prompt as root user. Install the servlets with command below.
root@server1 [~]# /scripts/addservlets –domain yourdomain.com
Scanning userdata…
Updating server.xml…
Restarting Tomcat
Done: .jsp support installed for yourdomain.com
Once done, a test jsp page is automatically created under your public_html directory which can be browsed with URL yourdomain.com/jsptest.jsp. It should show an output as below
Working JSP page!
This is a page to verify that .jsp support has been enabled
Date: Thu Feb 27 20:19:40 IST 2014
Remote Address: 59.94.222.149
Request Method: GET
Servlet Path: /jsptest.jsp
With our cPanel hosting plans, you get java version “1.7.0_51”, and Apache Tomcat/7.0.42. If you wish to enable .jsp support OR install servlets, get in touch with our Support Team & they will enable/install it for you.