by Dinesh Thakur Category: introduction to Servlet

Of these, HTTP servlets have some additional objects that provide session-tracking capabilities, the servlet writer can use the HttpSession interface to maintain the state of a client between client requests upto some time period. The capability of maintaining cookies is also provided by the HTTP servlets, The servlet writer uses the Cookie class to save small bits of information within the client machine, which can be retrieved at request processing time, Program illustrates the use of the HttpServlets.



 
by Dinesh Thakur Category: introduction to Servlet

When four requests are given to a Servlet program.

a) The Servlet container creates one object of that Servlet class.

b) Servlet container starts 4 threads on that object representing 4 requests on per request basis.

 
by Dinesh Thakur Category: introduction to Servlet

• Once web server is started one daemon process will be started to listen to clients continuously and to trap and take the client generated Http request.

• The process that runs continuously is called as daemon process.

 
by Dinesh Thakur Category: introduction to Servlet

• Listens to client request continuously (HTTP Request).

• Traps and takes client generated HTTP Request.

• Passes the HTTP request to an appropriate web resource program of web application (deployed web application).

 
by Dinesh Thakur Category: introduction to Servlet

JSP is a tag-based language, i.e., code is written within specified tags. It is developed by Sun Microsystems. Unlike servlet program, we can write HTML tags within the JSP program, making it easier to build.



 
by Dinesh Thakur Category: introduction to Servlet

Servlets are platform independent and can work with almost all the web servers. They can be executed on any web server that supports the servlet API. Some of the web servers having built-in support for Java servlets are Tomcat server (Apache), Java web server (Sun Microsystems), Enterprise server (Netscape), Zeus web server (Zeus Technology), Tengah application server (Weblogic) and Sun web server (Sun Microsystems).



 
by Dinesh Thakur Category: introduction to Servlet

Important terms used in web application are discussed here.

 
by Dinesh Thakur Category: introduction to Servlet

* Response status code indicates the status of generated response to display on the browser window.

* Every generated http response contains one http status code, default status code is 200.

* If web resource program generates warnings based web page then the status code is 100-199.   

* If web resource program generates successful web page then the status code is 200-299.

* If request given to one web site is forwarded to another web site then the status code will be 300-399.

* If our web resource program is incomplete or invalid to process the request then the status code will be 400-499.

* If server fails to execute our web application the status code will be 500-599.     

* 400-599 are error status codes, Using them the programmer can debug the problems related       to web application execution and server.

* 100-399 indicates success response status codes that means they display web pages on browser window having output content. So these status codes will not appear on the web pages.

* For related information on http response status codes refer page no 49 and 50.      

* Response headers provide instructions to browser window through web server towards displaying web pages on the browser window.

* The content type we have placed in PW.println statements becomes response body http response.



 
by Dinesh Thakur Category: introduction to Servlet

Apache Tomcat is a Open source java based web server software. At present tomcat 7.0 is compatible with jdk1.6/1.7. Tomcat default port no is 8080(changeable).To download tomcat we use www.apache.org.



 
by Dinesh Thakur Category: introduction to Servlet

* Every software and non-software objects life cycle (considering all the operations that are taken place from object birth to object death)

 
About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.



Search Content