Web and Application Server Interview Questions
What are Application Servers, Web Servers, LDAP servers and Database Servers ?
Web Servers:Apache, Microsoft IIS, Netscape, Domino etc
Application Servers:IBM WebSphere, BEA WebLogic, Apache Tomcat, Borland Enterprise Server, Fujitsu Interstage, JBoss, ATG Dynamo etc
Portal serversWebsphere Portal Server, JBoss Portal Server, etc
LDAP ServersIPlanetís directory server, SiemensDirX etc
Database ServersIBM DB2, Oracle, SQL Server, Sybase, Informix
What is the difference between a Web server and an application server ?In general, an application server prepares data for a Web server -- for example, gathering data from databases, applying relevant business rules, processing security checks, and/or storing the state of a userís session. The term application server may be misleading since the functionality isnít limited to applications. Its role is more as retriever and manager of data and processes used by anything running on a Web server. In the coming age of Web services, application servers will probably have an even more important role in managing service oriented components. One of the reasons for using an application server is to improve performance by off-loading tasks from a Web server. When heavy traffic has more users, more transactions, more data, and more security checks then more likely a Web server becomes a bottleneck.
What is a virtual host ?The term virtual host refers to the practice of maintaining more than one server on one machine. They are differentiated by their host names. You can have name based virtual hosts and IP address based virtual hosts.
For example:A name-based "virtual host" has a unique domain name, but the same IP address. For example, www.company1.com and www.company2.com can have the same IP address 192.168.0.10 and share the same Web server. We can configure the Web server as follows:
In this scenario, both www.company1.com and www.company2.com are registered with the standard domain name service (DNS) registry as having the IP address 192.168.0.10. A user types in the URL http://www.company1.com/hello.jsp in their browser. The user's computer resolves the name www.company1.com to the IP address 192.168.0.10. The Web server on the machine that has the IP address 192.168.0.10, so it receives the request. The Web server determines which virtual host to use by matching the request URL It gets from an HTTP header submitted by the browser with the "ServerName" parameter in the configuration file shown above.
Name-based virtual hosting is usually easier, since you have to only configure your DNS server to map each hostname to a single IP address and then configure the Web server to recognize the different hostnames as discussed in the previous paragraph. Name-based virtual hosting also eases the demand for scarce IP addresses limited by physical network connections [but modern operation systems support use of virtual interfaces, which are also known as IP aliases]. Therefore you should use name-based virtual hosting unless there is a specific reason to choose IP-based virtual hosting. Some reasons why you might consider using IPbased virtual hosting:
UNIX user: /etc/hosts
Windows user: C:\WINDOWS\SYSTEM32\DRIVERS\ETC\HOSTS
What is application server clustering ?An application server cluster consists of a number of application servers loosely coupled on a network. The server cluster or server group is generally distributed over a number of machines or nodes. The important point to note is that the cluster appears as a single server to its clients. The goals of application server clustering are:
Explain Java Management Extensions (JMX) ?JMX framework can improve the manageability of your application by
Explain some of the portability issues between different application servers ?Transaction isolation levels, lazy loading and dirty marker strategies for EJB, class loading visibility etc.
What is a Portal ?A portal is a Web site or service that offers broad range of resources and services like e-mail, forums, search engines, on-line shopping, news, weather information, stock quotes, etc. Portal is a term generally synonymous with the terms gateway or grand entrance into the Internet for many users. E.g. www.yahoo.com, www.aol.com, www.msn.com etc. A Web portal software allows aggregation of several back-end systems, processes, sites etc brought together through a single portal page. Portals also provide additional services such as single sign-on security, customization (i.e. personalization) etc.
What are the logical components to consider when building a portal to the Java Portlet specification
Portal Server:is an application, which aggregates portlet applications together in a presentable format to the user. In addition to being a presentation layer, it allows users to customize their views including what portlet applications to show, colors, images etc. Also provides additional services like single sign-on security etc.
Portlet Container:provides a run-time environment to portlets, much in the same way a servlet container provides the environment for servlets. The portlet container manages portlets by invoking their lifecycle methods (init(..), processAction(..), render(..), destroy() etc ). The container forwards requests to an appropriate portlet.When a portlet generates a response, the container sends it to the portal server to be rendered to the user.
Portlet:provides content to its calling portal container for the purpose of being displayed on a portal page. Portlets are like servlets but portlets do not generate complete HTML documents. They only generate fragments that are included on the final portal page. Portlet applications are essentially extended Web applications (i.e. a layer on top of servlets). Portlets also share the application context with servlets and JSPs and can even include the output of another servlet or JSP as part of their content. Userís actions are received within a portlet in the form of both action (to respond to userís interactions like search etc) and render methods (to paint the output of the portlet).
Note:Under the covers the GUI windows News, Stock Quote and Weather shown in the diagram are different applications, developed independently of each other and deployed as individual .war in the portal server.
How do Portlets differ from Servlets ?The Portlet API is capable of using the existing application server infrastructure. You can call an EJB from your portlet, or you can start and participate in a global transaction controlled by your application server. In other words, portlets are Web components like servlets and can do pretty much every thing that a servlet can do except for a few important differences:
What are portlet window states and portlet modes ?
Window states:To offer the user the ability to customize portlets, there are special window states like normal, minimized and maximized. A window state determines how much content should appear in a portlet. Normal will display the portletís data in the amount of space defined by the portal application, maximized will display only that portlet in the whole window, and minimized may display only one or two lines of text.
Portal modes:determine what actions should be performed on a portlet. There are three standard modes like View, Edit and Help. Optional modes are possible. The GenericPortlet class defines three empty methods doEdit(..), doView(..) and doHelp(..). Your subclasses can implement any of these methods.
Furthermore, the portlet can use these states and modes to determine what content it needs to show the user at any given point.
How do portlets provide customization in addition to window states and portlet modes ?To provide customization portlets support preferences, which are name/value pairs that can be assigned an initial value and later tailored to other values based on user preference. Preferences are initially defined within the portletís deployment descriptor file portlet.xml and accessed through the PortletPreferences object, which provides methods to retrieve, change or store preferences. Preferences can also be read-only and also can be verified with validators.
How would you achieve design flexibility in a portal to cater for different look and feel ?normal Website designers know the type and amount of the initial content but portal designers have to design the portal to be flexible enough to meet diverse clientsí and usersí needs. Design flexibility can be achieved by using CSS (Cascading Style Sheets) to avoid hard coding colors and images into the portal so that customers can easily customize (i.e. modify) the look of their portal.
J2EE Best Practices Interview Questions >>>