Apache Tomcat often Referred To As Tomcat Server, Is An Open-source Java Servlet Container Developed By The Apache Software Foundation (ASF).
1.Explain what is Jasper?
Jasper is a Tomcat’s JSP engine
It parses JSP files to compile them into JAVA code as servlets
At runtime, Jasper allows to automatically detect JSP file changes and recompile them
2.Mention what is the output of select * from tab?
It displays the default tables in the database
3.Explain how you can configure Tomcat to work with IIS and NTLM?
You have to follow the standard instructions for when the isapi_redirector.dll
Configure IIS to use “integrated windows security”
Ensure that in the server.xml you have disable tomcat authentication
4.Explain when you can use . and when you can use []?
If you are running a bean property, use the .operator, and if you are executing a map value or an array index,it is preferred to use the [] operator. Although you can use these operators interchangeably.
5.Mention what is the default port for Tomcat?
The default port for Tomcat is 8080. After initializing Tomcat on your local machine, you can verify ifTomcat is running the URL: http://localhost:8080
6.Mention what are the connectors used in Tomcat?
In Tomcat, two types of connectors are used
HTTP Connectors: It has many attributes that can be changed to determine exactly how it works and accessfunctions such as redirects and proxy forwarding
AJP Connectors: It works in the same manner as HTTP connectors, but they practice the AJP protocol inplace of HTTP. AJP connectors are commonly implemented in Tomcat through the plug-in technologymod_jk.
7.Mention what are the Catalina’s Configuration files?
Catalina consists of configuration files are
8.Explain how running Tomcat as a windows service provides benefits?
Running Tomcat as a windows service provides benefits like
Automatic startup: It is crucial for environment where you may want to remotely restart a system aftermaintenance
Server startup without active user login: Tomcat is run often on blade servers that may not even have anactive monitor attached to them. Windows services can be started without an active user
Security: Tomcat under window service enables you to run it under a special system account, which isprotected from the rest of the user accounts
9.Explain when to use SSL with Tomcat?
You would use Tomcat to handle connection, when you are running Tomcat as a stand-alone web server.
10.Explain how you can deploy a web application using WAR files?
JSPs, servlets, and their supporting files are placed in the proper subdirectories under the web appsdirectory in Tomcat. You can make all the files under the web apps directory into one compressed file,which ends with .war file extension. You can execute a web application by placing a WAR file in thewebapps directory. When a web server starts executing, it pulls out the WAR file’s contents into theappropriate webapps sub-directories.
11.Explain what is Tomcat Valve?
A tomcat valve- a new technology is introduced with Tomcat 4 which enables you to link an instance of aJava class with a specific Catalina container.
12.Mention with how many valves does Tomcat configured with?
Four types of valves Tomcat is configured with
13.Explain how servlet life cycles?
The life-cycle of a typical servlet running on Tomcat
loaded. If it is not than Tomcat wraps the servlet into Java Bytecode, that is executable by the JVM and forms an instance of the servlet
configuration files and act accordingly, as well as declare any resources it might require
servlet’s lifecycle, which tracks the servlet for a variety of statemchanges.
14.Explain what is the purpose of NAT protocol?
The purpose of NAT protocol is to hide private IP address from public IP address and give a certain levelof security to the organization.
15.Explain what does the MAC stands for?
MAC means Medium Access Control
16.Explain what is Tomcat Coyote?
Tom coyote is an HTTP connector based on HTTP/ 1.1 specification which receives and transport webrequests to the Tomcat engine by listening to a TCP/IP port and sent request back to the requesting client.
17.What is webserver? why it is used?
Transaction with HTTP request and HTTP response is called webserver. Using the internet listening theHTTP request and providing the HTTP response is also called webserver.It gives only html output. It willnot process business logic .They can provide Http server. They are static.
18.What is different between webserver and application server?
The basic difference between a web server and an application server is
as Web container which is used to interpret/execute web applications
containers 1. Web Container(for interpreting/executing servlets and jsps)
etc etc
19.What is tomcat? Can we deploy a servelet in tomcat?
Tomcat is a webserver, Which is support 3 –tier archeticture..
Yes we can
in web.xml
<web-apps>
<servlet-name>
<servlet-class>
20.What is the output of select * from tab?
it displays the default tables in database
21.What is the difference between Tomcat 4.1 and Tomcat 5.0?
Web server (for development) that supports servlets 2.3 and JSP 1.2 (Tomcat 4) or servlets 2.4 and JSP 2.0(Tomcat 5).
22.Suppose when we are starting startup.bat file of Tomcat server it is not started. DOS window appears for a Second only. What we need do?
Your set up might have been not done well.
Make sure you have added tomcat root directory path in the CATALINA_HOME environment variableand added the bin path in the path variable.
23.How web server handles multiple requests for same action class(Struts) concurrently?
Struts or any webserver makes new thread for each new request. so multiple request is served with newrequest object.
24.How to communicate between two webservers in two diff systems?
by using plug module
25.How will you clear the cache of Tomcat server?
The tomcat server keeps a copy of compiled servlets and JSP’s present in all deployed web application atthe following location.
$Tomcat_ServerworkCatalinalocalhost
To clear the cache, you just need to delete the folder corresponding to the web application for which youwant to clear the cache.
26.What all services are provided by Tomcat?
Tomcat server provides a host of services which are not provided by normal web servers like Apache WebServer. The following is a list of services provided by Tomcat:
1) Life cycle Management
2) Handling Web Requests
3) Thread Management
4) Connection pooling
5) Clustering
Apart from the above service, you can also tell about the various tomcat components about which noteveryone is aware in detail.
27.How will you create a database connection pool in Tomcat server?
The steps to configure connection pool:
1) Configure pool in context.xml inside conf folder of tomcat.
2) Perform a JNDI lookup of pool and get connection from data source.
The JDBC connection pooling page shows how one can create connection pool in tomcat server.
28.Suppose there is a clash between the version of library being shipped with your application and the library of Tomcat, How will you resolve it? (Take example of Log4J)
There should be only one jar file for a particular library and if there is a clash, you should be using theversion of library provided by the server which can avoid problems arising when deploying the applicationon client machines.
29.What is the directory structure of a web application deployed on Tomcat?
The typical web application structure which is deployed on tomcat is:
images
js
src
WEBINF
|classes
|lib
|web.
xml
index.
html
30.Will you classify Tomcat as web server or application server?
Ideally speaking, tomcat is neither a web server not application server because of the following points:
a) Tomcat has servlet and JSP engine present in it which is not provided by web servers
b) Tomcat can not run EJB based applications which can be run by application servers.
31.What are the steps to configure clustering in Tomcat server?
Apache Tomcat wiki lists down the steps for configuring clustering in the guide at Tomcat server clustering
32.How do you define welcome file list?
We can define welcome file list in web.xml deployment descriptor by using the welcomefilelist tag asshown in the following sample code:
<welcome?file?list>
<welcome?file>index.html</welcome?file>
<welcome?file>index.htm</welcome?file>
<welcome?file>index.jsp</welcome?file>
</welcome?file?list>
The actual welcome file being presented to the user shall be decided from the above list. If index.html ispresent then it shall be shown. If no index.html file is present in the root folder of web application, then
server tries to find a file with the name index.htm and that also fails then it finds index.jsp.
33.Why is Tomcat not an application server?
Application server is broader term where a host services apart from deploying a JSP/Servlet basedapplication are provided. Tomcat is a web server and not application server. This is because of the fact thatTomcat doesn’t provide services to install/manage EJB and JMS based applications.
34.How do you create multiple virtual hosts?
If you want tomcat to accept requests for multiple hosts e.g. www.myhostname.com then you must.
To add more sites just repeat and rinse, all webapps can share the same war file location and appbase.
35.What is Jasper?
Jasper is a program to read the .class files in binary format. This program can generate ASCII files , whichcan be used along with Jasmin Assembler. Jasper is intended for generating input into a class file browserwhich can produce the hierarchy of inheritance and composition maps from the .class files.
36.Suppose when we are starting startup.bat file of Tomcat server it is not started. DOS window appears for a Second only. What we need do?
Your set up might have been not done well. Make sure you have added tomcat root directory path in theCATALINA_HOME environment variable and added the bin path in the path variable.
37.How would you set up tomcat for remote debugging?
In windows environment , open up your startup.bat and add to file somewhere in beginning
Add this to end of your startup.sh file
call "%EXECUTABLE%" jpda start
%CMD_LINE_ARGS%
Make sure you comment out
call "%EXECUTABLE%" start
When you are connecting with eclipse, set your debug port at 8001. Now when you start your server , youwould see the message Remote debugging started