Skip to main content

Creating and Configuring Servlets


Configuring Servlets
You define servlets as a part of a Web application in several entries in the J2EE standard Web Application deployment descriptor, web.xml. The web.xml file is located in the WEB-INF directory of your Web application.
The first entry, under the root servlet element in web.xml, defines a name for the servlet and specifies the compiled class that executes the servlet. (Or, instead of specifying a servlet class, you can specify a JSP.) The servlet element also contains definitions for initialization attributes and security roles for the servlet.
The second entry in web.xml, under the servlet-mapping element, defines the URL pattern that calls this servlet.
Servlet Mapping

Servlet mapping controls the way you want to access your servlets
example of servlet mapping look like the image i attatched above


Servlet Initialization Attributes

You define initialization attributes for servlets in the Web application deployment descriptor, web.xml, in the init-param element of the servlet element, using param-name and param-value tags. The web.xml file is located in the WEB-INF directory of your Web application. For example i am attaching the image .this will clear the
doubt


i will come advanced feature of the Servlets in my second post

Comments

Popular posts from this blog

The Bourne Betrayal | Book Review

Novel by Eric Van Lustbader and Robert Ludlum I like all Robert Ludlum’s novels including those which are written by Evan Lastbadder. To me his novels have taken fiction to the next level. During my way back to Hyderabad from my last summer trip to hometown I bought paperback version of “The Bourne Betryal”. This novel was full of Lastbadder’s style of writing than Robert Ludlum’s one.  I took almost 6 months to complete it. This novel has something different to offer actually. Plot is exciting but the story is not very accelerating. Jason bourn and Martin Lindros, When martin Lindros decided to come back in the field operations with the aim to destroy Fadi and When Martin is out the track , Jason is the only help possible in the situation. Story takes you through various struggle of Jason to bring Martin back home. There are few things where author has not even paid any attention for example how does an ordinary Pakistani Waiter will have that much of information   Towa...

ipconfig/displaydns

Why does the aboave command prints URLs, Websites addresses that we have never accessed before ? When your system communicates with the DNS server for resolvingthe name queries, Your system builds the cache over the perios of time, This cache normally contains records from the host file and also the retrieved records from the recently resolved queries. Coming to the question that the site which were never accessed showing up there. DNS cache notes down positive and negative results as well. as you know caching is all about performance improvment. Now lets say you accessed Website1 and Website1 has some functionalities which makes it to communicate with Website2. Now Fortunately or unfortunately Website2 is blocked in your network and name query for this Website is not resolved. Still this unresolved queries will be recorded in DNS cache. I think those results are coming as they were initiated from your system implicitly. Issue this command to clean the DNS cache

Mobile Message Organizer

Got a basic requirement that i think every mobile should have, all the mail clients have this facility and i dont see any big difficulties on this other than the storage problem which is not a problem at all as we got GB of spaces in our memory cards. Well i am talking about the organizing the messages in Inbox , categorization of messages. Suppose i want to store all the messages from one of my friend say A in a folder called Personal, my existing mobile device Nokai E71 doesn't have this feature inbuilt (Ofcourse if you want you can make a folder and move the messages manually but here i am talking about the idea of automating this procedure). Only thing we need to do is , we have to store the rules in separate location , rules will be defined by the user and then device will follow these rules.There are no or very less software available which satisfy this requirement for mobile device.this is so simple but basic requirement as per the end user. I am going to make this one ...