===============================================
SEARCH400.COM WEBSPHERE STRATEGIES TIP
May 17, 2001
More WebSphere Strategies tips at 
http://search400.techtarget.com/tipsIndex/0,289482,sid3_tax2f9,00.html
===============================================

SPONSORED BY: Postmaster Direct
===============================================
GET THE INFO YOU WANT TODAY
What do YOU want in your e-mailbox? How about FREE info and 
offers about computers, networking, wireless devices, 
finance and lots more? Visit
http://search400.techtarget.com/postmasterDirect/1,289639,sid3,00.html, 
choose the topics that interest you, and you'll get the 
e-mail you want.

===============================================

The servlet: Backbone of WebSphere Application Server 
By Bob Cancilla

The mainstay of the WebSphere Application Server, or any 
other Java application server (BEA Weblogic, 
Tomcat/Jakarta), is the servlet. A servlet is a specialized 
Java class (program). It requires a Java application server 
and an HTTP server.

The Java Servlet API is a set of Java classes that 
implement an interface between a Web server (HTTP server) 
and a Web client (browser). The Java Servlet API is 
implemented by two Java packages:

* javax.servlet
* javax.servlet.http

The javax.servlet package contains classes that are 
protocol-independent and may be used with any protocol such 
as HTTP or FTP. The javax.servet.http package contains 
classes that are HTTP-specific. 

A Web client uses a standard URL to access an HTTP server. 
The HTTP server parses the request and passes the request 
to the Java application server (WebSphere) that loads the 
servlet (if it is not loaded), initializes the servlet, 
creates a thread for the client and invokes the servlet.

The servlet API includes function such as doGet to handle 
the HTTP GET method and the doPost that handles the HTTP 
POST method. Those functions retrieve parameters passed to 
the server by the client. Parameters may be passed either 
as QUERY_STRING (part of the URL via the GET method), or 
STDIN file (via the POST method). They parse the variables 
out, initiate them and translate any URLENCODEd strings. 

The application server can load a servlet on demand or when 
the server is started. The application server is a 
sophisticated operating system that resides on top of the 
base machine operating system (OS/400 in our case). When a 
servlet is loaded, the server will cause it to execute its 
INIT method that can retrieve data or perform other general 
housekeeping functions.

The application server allocates threads on behalf of 
clients and makes requests and processes threads available 
to the one copy of the servlet. Variables may be global and 
shared between all clients, or they may be thread-specific 
and unique to the client. Client-specific data must be 
properly declared and managed via Java serialization and 
proper attribute declaration.

The application server can implement persistence so that a 
conversation between the client and the Web server may 
occur. The application manages the concept of session that 
retains variables and other resources for a specific user 
via a special servlet API class called the HTTPSession 
class. 

Servlets can use the JDBC to retrieve data from the 
database and then format and write HTML back to the 
browser. The application server implements three methods to 
invoke other servlets on behalf of the client, linking, 
chaining, and direct Java calls. The servlet can also 
invoke Java Server Pages (JSP) to simplify the integration 
of variable data with HTML. 

One of the best in-depth discussions of the servlet, which 
includes examples, is the IBM Redbook: Servlet and JSP 
Programming with IBM WebSphere Studio and Visual Age for 
Java SG24-5755-00 
(http://publib-b.boulder.ibm.com/Redbooks.nsf/9445fa5b416f6e32852569ae006bb65f/777c992a61626c7d882568660004d868?OpenDocument).
 

See also the Java Servlet Specification Version 2.3 at 
http://java.sun.com.

----------------------------------------------
About the author: Bob Cancilla is managing director of 
IGNITe/400 (http://www.ignite400.org), an electronic 
iSeries 400 Internet users group. He is also author of the 
book Getting Down to e-business with AS/400 
(http://www.digitalguru.com/dgstore/product.asp?isbn=1583470107&ac_id=55)

-----------------------------------------------------------
ADVICE ON WEBSPHERE AND WEB DEVELOPMENT
-----------------------------------------------------------

Do you have questions about WebSphere and Web development? 
Our search400 experts, who include Jim Mason and Dave 
Slater, can help. Submit your Ask the Expert questions at 
http://search400.techtarget.com/ateQuestion/0,289624,sid3_tax285218,00.html

Or to view Web development questions that have already been 
answered, go to
http://search400.techtarget.com/ateAnswers/0,289620,sid3_tax285218,00.html

-----------------------------------------------------------
FEATURED BOOK
-----------------------------------------------------------

Title: WebSphere V3.5 Handbook: Using Websphere Application 
Server Standard and Advanced Editions
Author: Ken Ueno et al
Description: Successfully install and configure WebSphere 
V3.5; then use WebSphere to build applications that 
incorporate JavaServer Pages, servlets, Enterprise 
JavaBeans, JDBC, XML, and other powerful Web technologies. 
Discover how to use industry standards such as HTTP, IIOP 
and LDAP to integrate WebSphere into heterogeneous Web 
environments. Learn how to make the most of WebSphere's 
session management and transaction support capabilities; 
tune WebSphere for maximum performance and scalability; and 
much more.
http://www.digitalguru.com/dgstore/product.asp?isbn=0130416568&ac_id=55

-------------------------------------------





If you no longer wish to receive this newsletter simply reply to 
this message with "REMOVE" in the subject line.  Or, visit 
http://search400.techtarget.com/register 
and adjust your subscriptions accordingly. 

If you choose to unsubscribe using our automated processing, you 
must send the "REMOVE" request from the email account to which 
this newsletter was delivered.  Please allow 24 hours for your 
"REMOVE" request to be processed.

Reply via email to