Adv Java - [Servlet: Database Connectivity]

♠ Posted by Unknown in

DataBase Connectivity on Servlet

This example is showing the DataBase connectivity to fetch the result of particular student from the SQL Table. DataBase may resides on server-side and establish ODBC connection between database and Java class.

Adv Java - [Servlet: Hyperlink Example]

♠ Posted by Unknown in
Servlet Example

The Example that display the use of hyperlinks among several servlets. The Servlets are called to each other by referencing the java class name to the anchor element of HTML.

Adv Java - [Servlet: Useful Methods]

♠ Posted by Unknown in

Useful Methods of Servlet

 Servlets are simply Java classes that follow three basic rules:

  1. An HTTP Servlet must extend javax.servlet.http.HttpServlet (or extend an abstract class that does).
  2. The Servlet must implement at least one of the following metheods: doGet(), doPost(), doPut(), doDelete(), init(), destroy(), or service().
  3. The Servlet can optionally implement init(), destroy(), or getServletInfo().

Adv Java - [Servlet: Multithreaded]

♠ Posted by Unknown in

Multithreading into Servlet


The servlet container has a pool of threads that it will dispatch to handle client requests. It is quite likely that two clients arriving at the same time could be processing through your service() at the same time. Therefore the service() method must written in a thread-safe manner. Any access to common resources will need to be guarded by using the synchronized keyword.

Adv Java[Servlet: Session Management]

♠ Posted by Unknown in

Servlet Session Management


HTTP is a “sessionless” protorcol, so you cannot tell from one server hit to another if you’ve got the same person repeatedly querying your site. Or if it is a completely different person. A great deal of effort has gone into mechanisms that will allow Web developers to track sessions. Companies could not do e-commerce without keeping track of a client and the items they have put into their shopping cart, for example.

Adv Java [Servlet: Life Cycle]

♠ Posted by Unknown in

Servlets


Client access from the Internet or corporate intranets is a sure way to allow many users to access data and resources easily. This type of access is based on clients using the World Wide Web standards of Hypertext Markup Language (HTML) and Hyper Text Transfer Protocol (HTTP). The Servlet API set abstracts a common solution framework for responding to HTTP requests.