Tomcat Interview Questions and Answers
Prepare for your Interview today!
// Assuming you are in a Servlet extending HttpServlet
// This will look for a file called "/more/cowbell.properties" relative
// to your servlet Root Context
InputStream is = getServletContext().getResourceAsStream("/more/cowbell.properties");
Properties p = new Properties();
p.load(is);
is.close();
The basic difference between a web server and an
application server is Webserver can execute only web applications i,e servlets and JSPs and has only a single container known as Web container which is used to interpret/execute web
applications.
Application server can execute Enterprise application, i,e (servlets, jsps, and EJBs) it is having two containers
1. Web Container(for interpreting/executing servlets and jsps)
2. EJB container(for executing EJBs). it can perform operations like load balancing , transaction demarcation etc.
If you want tomcat to accept requests for different hosts e.g. www.myhostname.com then you must
No. If you can edit Tomcat's startup scripts, you can add "-D" options to Java. But there is no way to add such properties in web.xml or the webapp's context.
Follow the standard instructions for when the isapi_redirector.dll
<Connector port="8009" enableLookups="false" redirectPort="8443" protocol="AJP/1.3" tomcatAuthentication="false" />
Most helpful rated by users: