Print This Article Post Comment Add To Favorites Email to Friends Ezine Ready

Servlet Packages And Task In Java

By: Infocampus Home | Computers-and-Technology


Introduction :

Servlet provides a component-based, platform-independent method for building Web-based applications , without the performance limitations of CGI programs. Servlets have access to the entire family of Java APIs, including the JDBC API to access enterprise databases.

Java Servlets are programs that run on a Web or Application server and act as a middle layer between a request coming from a Web browser or other HTTP client and databases or applications on the HTTP server.
Using Servlets, we can collect input from users through web page forms, present records from a database or another source, and create web pages dynamically.
Java Servlets often serve Advanced java training in bangalore the same purpose as programs implemented using the Common Gateway Interface (CGI). But Servlets offer several advantages in comparison with the CGI.Performance is significantly better.
Features Of Servlet :
- Servlets execute within the address space of a Web server . It is not necessary to create a separate process to handle each client request .
- Servlets are platform-independent because they are written in Java .
- Java security manager on the server enforces a set of restrictions to protect the resources on a server machine. So servlets are trusted.
- The full functionality of the Java class libraries is available to a servlet. It can communicate with applets, databases, java/j2ee classes bangalore or other software via the sockets and RMI mechanisms that you have seen already.
Servlets Tasks:
Servlets perform the following major tasks:
- Read the explicit data sent by the clients (browsers). This includes an HTML form on a Web page or it could also come from an applet or a custom HTTP client program.
- Read the implicit HTTP request data sent by the clients (browsers). This includes cookies, media types and compression schemes the browser understands, and so forth.
- Process the data and generate the results. This process may require talking to a database, executing an RMI or CORBA call, invoking a Web service, or computing the response directly. Java training center bangalore
- Send the explicit data (i.e., the document) to the clients (browsers). This document can be sent in a variety of formats, including text (HTML or XML), binary (GIF images), Excel, etc.
- Send the implicit HTTP response to the clients (browsers). This includes telling the browsers or other clients what type of document is being returned (e.g., HTML), setting cookies and caching parameters, and other such tasks.
Servlets Packages:
Java Servlets are Java classes run by a web server that has an interpreter that supports the Java Servlet specification.
Servlets can be created using the javax.servlet and javax.servlet.http packages , which are a standard part of the Java's enterprise edition, java course in bangalore an expanded version of the Java class library that supports large-scale development projects.
Servlet Life Cycle :
A servlet life cycle can be defined as the entire process from its creation till the destruction. The following are the paths followed by a servlet
-The servlet is initialized by calling the init () method.
-The servlet calls service() method to process a client's request.
-The servlet is terminated by calling the destroy() method.
- Finally, servlet is garbage collected by the garbage collector of the JVM.
The init() method :
The init method is designed to be called only once. It is called when the servlet is first created, and not called again for each user request. Best core java training in bangalore So, it is used for one-time initializations, just as with the init method of applets.
The service() method :
The service() method is the main method to perform the actual task. The servlet container (i.e. web server) calls the service() method to handle requests coming from the client( browsers) and to write the formatted response back to the client.
Each time the server receives a request for a servlet, the server spawns a new thread and calls service. The service() method checks the HTTP request type (GET, POST, PUT, DELETE, etc.) and calls doGet, doPost, doPut, doDelete, etc. methods as appropriate.
The destroy() method :
The destroy() method is called only once at the end of the life cycle of a servlet. This method gives servlet a Advanced java training in bangalore chance to close database connections, halt background threads, write cookie lists or hit counts to disk, and perform other such cleanup activities.
This is the short description about the Servlet . To get the deep knowledge on java course join Infocampus Software Training Institute .




Article Source: https://www.eArticlesOnline.com

About the Author:
Infocampus provides best Advanced Java Training in Bangalore . It provides java training with the complete practical session . Java course is available for weekdays & weekends on flexible timing with the less fees. Payment in installament option is available for java/j2ee classes .
Learn OOPs concept , packages , threading , struts framework , JDBC in Core & Advanced java classes . Infocampus provides best core java training with the real time project . Trainers having 10+ years experience.
To book the seat for free demo class call at : 9738001024 or to know the syllabus of
Advanced java training enquire at : http://www.infocampus.co.in/java-training-bangalore.html

Tags: , , , ,

Please Rate this Article

 

Not yet Rated

Click the XML Icon Above to Receive Computers-and-Technology Articles Via RSS!

Recent Related Articles From Computers-and-Technology

  • An Overview On Ios 11 By Top Iphone App Development Companies In India
    By: Nirav Patel | Jan 6th 2018
    The finished version of the highly anticipated software iOS 11 is out now. Top-notch iPhone app development companies have already geared themselves with all the resources required to build an app for the latest iOS 11. Read

  • How Technology Impacted On Real Estate Sector
    By: hallmark builders | Jan 6th 2018
    Technology is used in different industries like hospitality, business, agriculture, communication, transportation, education and many more. As in the same way real estate sector has no exceptional with technology. There are few ways how real estate sector is depended on technology like marketing and advertising, People hunt ... Read

  • New Features In Java 8
    By: Infocampus | Jan 6th 2018
    Java 8 or JDK 1.8 is the most significant expansion of the Java language yet. Java 8’s new features such as Lambda Expressions, Stream APIs, Nashorn, Compact Profiles, new Time APIs increase the expressive power of the platform and make it easier for developers to take advantage of modern, multicore processors. This artic ... Read

  • Ios - 8 Principles Of Ios Development To Know Before Starting Your App
    By: Infocampus | Jan 6th 2018
    Building up a local iOS application can be a complex process. The developer you hire will be instrumental at all times, got the opportunity to be a professional with the correct blend of abilities to see your application through the outline and coding stages. That is the reason, before you begin searching for a designer; it ... Read

  • Understanding Python Basics
    By: Infocampus | Jan 5th 2018
    you will learn some Python basics, such as using the print function to display output. You will read about using variables and how to assign values to variables, and you will gain an understanding of their data types. By the end of this chapter, you will know how to get data into a script by using the input function and wri ... Read

  • Swift- A Powerful Open Language That Lets Everyone Build Amazing Apps.
    By: Infocampus | Jan 5th 2018
    Begin creating iOS Apps (Swift) is the ideal beginning stage for figuring out how to make applications that keep running on iPhone and iPad. View this arrangement of incremental lessons as a guided prologue to building your first application"including the instruments, significant ideas, and best practices that will facil ... Read

  • Implementing Iterable Interface In Java To Enable For-each Loop Based Iteration
    By: Infocampus | Jan 4th 2018
    how to implement java.lang.Iterable on a class to enable for-each loop based iteration through the collection of objects stored in that class. Tutorial starts off with explaining how Iterable and for-each loop are related, then explains how to implement Iterable, and finally shows a Java code example showing Iterable interf ... Read

  • Important Things You Need To Know About Selenium
    By: Infocampus | Jan 4th 2018
    Selenium can be a champion among the most able mechanical assemblies in the QA Engineers' munitions store. Shockingly, it can be dull to make, a terrible dream to keep up, and it can convey far an inordinate number of false negatives. Read

  • Swift -a New Programming Language For Os X And Ios
    By: Infocampus | Jan 3rd 2018
    With regards to speed, Swift is incredible. Swift is likewise present day with highlights like terminations, various return writes, and namespaces. Swift is totally local to both Cocoa and Cocoa Touch. Swift will be prepared for primetime out of the door," and will highlight "finish Xcode bolster." Additionally, when iOS ... Read

  • Learn Python Programming Step By Step
    By: Infocampus | Jan 3rd 2018
    we aim to teach all basic to advanced level Python programming concepts to a large no. of aspirants in the most efficient way. We've organized this course in such a manner that you can learn Python with least efforts, without investing a lot of your time and finally be able to apply this knowledge to your live projects. Read


Copyright © 2005-2015 eArticlesOnline, LLC - All Rights Reserved
Terms of Service | Privacy Policy