The servlet container is the core J2EE technology that powers the web tier.

Rather than recreating the wheel, JBoss allows you to integrate the servlet container of your choice.

Edit server.xml to change the port tomcat listens on.

In a well-engineered application, componets in each tier are "highly cohesive" and "loosely coupled".

In the presentation tire, it is known as the Moled/View/Controller pattern.

The WAR file, as you might guess from its name(Web ARchive), is a collection of presentation tier files.

Notice that the URL of your web application is the same as the WAR file name. This URL is called the Context Root.

Your compiled java classes and library JARs are stored in the WEB-INF directory. Files in WEB-INF are hidden from public view.

We can call a resource stored in WEB-INF, as long as it was configured in web.xml.

//Redirect to destination page.
RerquestDispatcher dispatcher =	
dispatcher.forward(request. response);
List carList = new ArrayList();
carList.add(new CarBean("Toyota", "Camvy", "2005"));
request.setAttribute("carList", carList);
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<c:forEach items='${carList}' var 'car'>


the servlet-mapping section exposes hidden WEB-INF resources to the public.

Just as WAR file contains a web.xml deployment descriptor,
an EAR file contains a file named application.xml.

The EAR file's META-INF derectory stores application.xml.

the context root is your web site's URL.

When your WAR file is deployed inside on EAR, this element allows you to override the physical name of the WAR and use whatever URL you'd like.