Вы находитесь на странице: 1из 10

1. What is a container?

Servlets dont have a main method , they are under the control of another
java application ,Container.
Tomcat is an example of a container.
When web server gets a request for a servlet (not a static html) page it hands
the request not to the servlet but to the container
Life without Container
Networking : Create a socket connection with the server and create a listener for the socket
Threading : Create a thread manager
Security : Implement security
Filtering things like logging
JSP support
Memory management

Life with it
Communications Support : Container knows the protocol b/w itself and web server

Lifecycle management : life and death of


servlets.loading,instantiating,initializing,invoking methods and making it
eligible for garbage collection
Multithreading support : creates a new thread for every servlet
request.Synchronization has still to be taken care of.
Declarative Security : security is configured in xml dd, dont have to hardcode
it.
JSP support : translates jsp to servlets

2. How the container handles a request

3. How should the container map servlets to URLs

4. Servlet has 3 names


a. Client knoiwn URL Name
b. Deployer known internal name
c. Actual file name

5. DD gives a declarative mechanism for customizing your web application


without touching application code.
6. U can use DD to customize other aspects of your web app
a. Security roles
b. Error pages
c. Tag libraries
d. Initial configuration information

e. And if full J2EE sever,you can even declare that youll be accessing
specific EJBs
Advantages of DD
Touching source code
Fine tuning App
Adapt to different resources
Dynamic security
Lets Non-programmers deploy

Gag : dilbertian job


7. Seperation of concerns : MVC
With the business logic in a standalone java class,it can be reused,hence it
shud not be in the servlet
Never assume business logic will be always accessed from the web

Spec always changes

8. Task and responsibilities

9. J2EE container
Its a super spec, it includes other specifications
a. Servlets 2.4
b. JSP2.0
c. EJB 2.1
10.Web Container(Servlets and JSP) is for web components and EJB container is
for business components.
11.A fully complaint J2EE container must have a web container and an EJB
container along with other things likeJNDI and JMS implementation
12.Tomcat container does have the ability to act as basic HTTP server.
13.But for HTTP server capability tomcat is not as robust as Apache web server
14.Common J2EE servers : BEA weblogc,JBoss AS,IBM-Websphere

Вам также может понравиться