The document discusses servlets, including their life cycle, handling HTTP requests and responses, and session tracking using cookies. It provides details on:
- The init(), service(), and destroy() methods that are central to a servlet's life cycle.
- How servlets can read data from HTTP requests using the HttpServletRequest interface and write data to HTTP responses using the HttpServletResponse interface.
- How servlets can maintain session state across requests using the HttpSession interface and cookies.
- Examples of simple servlets that retrieve and display request parameters, and handle GET and POST requests.
The document outlines an agenda for a presentation on AngularJS that covers:
1. An introduction to AngularJS and its core features like two-way data binding, templates, and MVC architecture.
2. Explanations and examples of key AngularJS concepts like directives, expressions, forms, services, modules, routing, and scopes.
3. Discussions of AngularJS advantages like fast development and scalability, and disadvantages like complexity.
4. References for further learning and a question/answer session.
This document provides an overview of HTTP and REST APIs. It describes how HTTP allows sending documents over the web using URLs to identify resources and HTTP verbs like GET, PUT, DELETE and POST. It defines common response codes. It explains that REST stands for Representational State Transfer and relies on a stateless, client-server architecture using the HTTP protocol. The key design constraints of REST include having a uniform interface, being resource-based and using representations to manipulate resources with self-descriptive messages. Benefits include statelessness for scalability, cacheability to improve performance, separating clients from servers, and using a layered system with intermediary servers.
- REST (Representational State Transfer) uses HTTP requests to transfer representations of resources between clients and servers. The format of the representation is determined by the content-type header and the interaction with the resource is determined by the HTTP verb used.
- The four main HTTP verbs are GET, PUT, DELETE, and POST. GET retrieves a representation of the resource and is safe, while PUT, DELETE, and POST can modify the resource's state in atomic operations.
- Resources are abstract concepts acted upon by HTTP requests, while representations are the actual data transmitted in responses. The representation may or may not accurately reflect the resource's current state.
HTTP headers carry important information in web requests and responses between browsers and servers. They define the request and response details like the request method, resources used, sender and receiver details, and content type. Common HTTP headers provide information on the request method, resources consumed, sender and destination, and content type. Tools like the Live HTTP Headers browser add-on or inspect element can be used to view HTTP headers and their carried information.
Web Application Penetration Testing Introductiongbud7
This document provides an overview of web application penetration testing. It discusses the goals of testing to evaluate security by simulating attacks. The testing process involves gathering information, understanding normal application behavior, and then applying targeted techniques to find weaknesses. The document outlines the reconnaissance, mapping, and active testing phases. It also demonstrates various tools like Burp Suite, W3AF, and SQL injection and cross-site scripting attacks.
This document provides an overview of Java servlets, including:
- Servlets reside on the server-side and generate dynamic web pages. They handle HTTP requests and responses.
- Servlets have a lifecycle of initialization, processing requests, and destruction. The servlet receives a request from the web server, processes it, and returns a response which is sent back to the client.
- Servlets offer advantages over CGI like better performance through multithreading and portability through the Java programming language. Common servlet APIs and interfaces are described.
Cross-site scripting (XSS) is a type of vulnerability in web applications that allows attackers to inject client-side scripts. There are three main types of XSS - reflected XSS occurs when malicious scripts are included in links or requests to the server, stored XSS happens when scripts are stored on the server through forums or comments, and local XSS executes without contacting the server through PDFs or Flash. XSS can lead to compromised user accounts, denial of service attacks, or access to users' local machines. Developers can prevent XSS through input validation, encoding output, and keeping software updated.
GenericServlet defines a generic, protocol-independent servlet that uses the service() method to handle requests. HttpServlet extends GenericServlet to define an HTTP protocol specific servlet that uses doGet and doPost methods to handle requests. Servlets follow a lifecycle of initialization, service, and destruction when loaded and unloaded from the servlet container.
This document discusses servlets and their properties. It defines servlets as Java programs that run on a web server and handle requests from the server. Servlets process requests, generate responses, and send them back to the server. The document outlines the basic execution steps of a servlet and the servlet architecture. It describes advantages of servlets like being platform independent and faster than CGI. The document also discusses the servlet container, its functions like loading servlets and managing the lifecycle, and the services it provides such as encoding/decoding messages, resource management, security, and session handling.
In this workshop, students will learn the elements of HTML and CSS and use them to create a website. Using a text editor and web browser, students will edit web page templates and use them to make their own website.
The document discusses advanced topics in Spring MVC, including annotation driven controllers, arguments and return types, and validation. It provides details on annotations like @Controller, @RequestMapping, @PathVariable, @ModelAttribute, @CookieValue, @HeaderValue, @DateTimeFormat, @RequestBody, and @ResponseBody and how they can be used to configure controller methods. It also describes what types of arguments controller methods can accept and what return types are allowed.
This document provides an overview of web services. It defines a web service as a web page meant to be consumed programmatically rather than via a web browser. Examples given include e-commerce sites using shipping APIs and weather data being provided to news sites. Benefits outlined are simplicity, loose coupling, statelessness, and firewall friendliness. The document also discusses when to use and avoid web services and describes the main types - SOAP and REST. It provides details on RESTful services using JAX-RS annotations and extracting parameters. For SOAP, it explains the communication protocol and use of WSDL and UDDI.
This document provides an introduction to web development technologies including HTML, CSS, JavaScript, and PHP. It explains that HTML is the standard markup language used to structure web pages, CSS is used to style web pages, and JavaScript adds interactivity. It also distinguishes between client-side and server-side technologies, noting that JavaScript, HTML, and CSS are client-side and run in the browser, while server-side languages like PHP run on the web server. The document provides examples of how each technology works and is used to build dynamic web pages.
This document provides an overview of Enterprise Java Beans (EJB). It describes EJB as a specification that allows developing secure, robust, and scalable distributed applications in Java. It discusses the different EJB components like session beans, message-driven beans, and entity beans. It also compares EJB with other technologies like RMI, web services, and Java Message Service (JMS).
Servlets are Java classes that extend the functionality of a web server by dynamically generating web pages. Servlets use the Java programming language and are managed by a servlet container that handles loading, unloading, and directing requests. Servlets provide advantages over older technologies like CGI scripts such as better performance, portability, security, and access to full Java features. The basic servlet lifecycle involves initialization, handling requests, and destruction. Servlets can be generic or HTTP-specific, with HTTP servlets providing specialized methods for different HTTP request types. Sessions allow servlets to maintain state across multiple requests.
This document provides an overview of HTML5 features, including new tags and capabilities. It describes HTML5's audio, video, form, and graphics capabilities using new tags like <audio>, <video>, <canvas>, and CSS3 features like gradients and animations. It compares old and new tags, and provides code examples for SVG graphics, the <canvas> element, and CSS animations.
The document provides an introduction to web APIs and REST. It defines APIs as methods to access data and workflows from an application without using the application itself. It describes REST as an architectural style for APIs that uses a client-server model with stateless operations and a uniform interface. The document outlines best practices for REST APIs, including using HTTP verbs like GET, POST, PUT and DELETE to perform CRUD operations on resources identified by URIs. It also discusses authentication, authorization, security concerns and gives examples of popular REST APIs from Facebook, Twitter and other services.
The document discusses Node.js and Express.js concepts for building web servers and applications. It includes examples of creating HTTP servers, routing requests, using middleware, handling errors, templating with views and layouts, and separating code into models and routes.
This document provides an overview of server-side web programming and different technologies used to create dynamic web pages, including Common Gateway Interface (CGI), servlets, and JavaServer Pages (JSP). CGI allows building dynamic web sites by running programs on the server that can generate HTML responses. Servlets provide a Java-based alternative to CGI with improved performance, portability, and security. Servlets use a request-response model and are executed by a servlet container. JSP is a technology that simplifies web page programming by mixing static elements like HTML with scripting code.
This document provides an introduction to servlets, including concepts of CGI, advantages of servlets over CGI, servlet life cycle, servlet deployment, and servlet API. Some key points:
- CGI enables a web server to call an external program and pass HTTP request information, but has performance and scalability disadvantages due to starting a new process for each request.
- Servlets address CGI limitations by running within a JVM on the server, allowing requests to be handled on threads rather than processes for better performance.
- The servlet life cycle includes initialization via init(), processing requests via service()/doGet()/doPost(), and cleanup via destroy().
- Servlets are deployed by placing class
This document provides an overview of Java servlets. It defines servlets as Java programs that extend the capabilities of servers and respond to web requests. It compares servlets to CGI scripts, noting that servlets have better performance since they use threads instead of processes to handle requests. The document outlines the servlet lifecycle and architecture, how to create a servlet class, and key interfaces in the servlet API like Servlet, GenericServlet, and HttpServlet.
Http Server Programming in JAVA - Handling http requests and responsesbharathiv53
This ppt contains HTML forms and CGI; HTTP; Servlet Programming; The Life Cycle of a
Servlet; Using Tomcat for Servlet Development; A simple Servlet;
deployment of simple servlets, web server (Java web server / Tomcat/ Web
logic) The Servlet API; The Javax.servlet Package; Reading Servlet
Parameter; The Javax.servlet.http package; Handling HTTP Requests and
Responses, HTTP GET and POST methods, Using Cookies; Session
Tracking
Servlets are Java programs that extend the functionality of web servers. Servlets offer advantages over CGI like improved performance since they execute within the server's memory space rather than as separate processes. The lifecycle of a servlet involves initialization, processing requests, and destruction. Tomcat is a popular open source web server that supports servlets. It provides APIs and handles loading, executing, and unloading servlets in response to HTTP requests. Servlets can handle GET and POST requests, with GET parameters appearing in the URL and POST parameters in the request body.
This document provides an overview of Java servlets including:
- Servlets allow Java code to generate dynamic web page content in response to HTTP requests. They are hosted by a servlet container inside a web server.
- The servlet lifecycle involves initialization, processing requests, and destruction. Common methods are init(), service(), destroy().
- The javax.servlet and javax.servlet.http APIs provide interfaces and classes for building servlets and handling HTTP requests/responses.
- Servlets can collaborate by forwarding or redirecting requests between servlets using methods like RequestDispatcher and HttpServletResponse.
- Session management techniques like cookies, hidden fields, and HTTP sessions allow servlets to maintain state across
This document provides information on servlets including:
- Servlets allow dynamic content and interaction for web applications and can be used to build search engines, e-commerce sites, and more.
- Servlets have better performance than CGI since they remain loaded in memory between requests rather than starting a new process for each request.
- Servlets follow a request-response lifecycle and provide APIs to handle HTTP requests and responses through the Servlet, HttpServletRequest, and HttpServletResponse interfaces.
The RequestDispatcher interface provides methods for dispatching a request to another resource like a servlet, JSP, or HTML page. The forward() method dispatches the request to another resource and forwards the request, while include() includes the response from another resource in the current response. For example, a servlet can forward a request to a welcome page servlet if authentication succeeds, or include an HTML page if authentication fails to show the login form again.
The document discusses web containers and how they work. It begins with definitions of key terms like web container, web server, application server, and EJB container. It then explains that a web container is responsible for managing the lifecycle of servlets and mapping URLs to servlets. The document also discusses how web containers use servlet engines to execute servlets and JSP engines to execute Java Server Pages. It provides details on the popular Apache Tomcat web container, including how to install, configure, deploy applications to, and develop applications on Tomcat.
This document provides an introduction to Java servlet technology. It discusses how servlets address limitations of CGI scripts by providing a portable way to generate dynamic web content from the server side using Java. Key topics covered include the servlet interface, lifecycle, and advantages over CGI such as improved performance and portability. Configuration and use of servlets within Eclipse and Tomcat are also explained.
Java Servlet Programming under Ubuntu Linux by Tushar B KuteTushar B Kute
The document provides information on programming simple servlets under Ubuntu GNU/Linux. It discusses what can be built with servlets, the benefits of servlets over CGI, definitions of servlet containers and servlet architecture. It also covers the servlet lifecycle, request and response objects, and the steps to write a simple servlet class, compile it, deploy it on Tomcat, and run it.
Servlets are Java programs that extend the functionality of web servers. They allow dynamic content and processing on the server-side. Servlets are efficient, robust, portable, and persistent. The lifecycle of a servlet involves initialization via init(), processing requests via service(), and destruction via destroy(). Servlets can be deployed on Java web servers or J2EE application servers using deployment tools.
The document discusses servlet technology and how it is used to create dynamic web applications. Some key points:
- Servlet technology allows creating web applications that reside on the server-side and generate dynamic web pages.
- Servlets are more robust and scalable than previous CGI technology due to being implemented in Java.
- The servlet API defines interfaces like Servlet, GenericServlet, HttpServlet, ServletRequest, and ServletResponse that are used to build servlets.
This document provides an overview of key concepts related to Java servlets and JavaServer Pages (JSP) technology. It discusses how servlets use a request/response model and have a defined lifecycle. Servlets are implemented as Java classes and can allow parallel requests by being thread-safe. The document also notes that servlets have disadvantages for generating HTML output, which JSPs address. It recommends best practices for designing thread-safe servlets that allow parallel requests.
This document provides information on Java servlets including: what servlets are and their advantages; the servlet architecture and lifecycle including initialization, processing requests via doGet and doPost methods, and destruction; how to deploy servlets in an application server; and how servlets handle form data submission. Servlets act as a middle layer between web requests and applications/databases, and allow dynamically generating web pages.
JSP and Servlets allow developers to create dynamic web applications. JSPs are text files that combine HTML and scripting tags, and get compiled into Java servlets. Servlets are Java programs that extend the functionality of web servers by processing requests and generating responses. The servlet lifecycle involves loading, instantiating, initializing, servicing requests, and destroying servlets. This allows servlets to handle each step of receiving and fulfilling user requests in web applications.
Server side programs can be written using different server-side technologies , such as Common Gateway Interface (CGI) , Active Server Pages (ASP) and Servlets.
CGI scripts are written in C , C++ or perl programming languages .
In case of an application server using CGI script to process client request , the server creates a separate instance of the CGI script to process the request.
As a result, the efficiency of the server is affected when there is large number of concurrent requests.
Liit tyit sem 5 enterprise java unit 1 notes 2018 tanujaparihar
BSc IT Sem 5 Enterrprise Java Notes for free download exam oriented notes mumbai university advance java notes Java Server Side Technology notes,liit,liit coaching classes,liit dadar,liit andheri,liit notes
Best methods of staff selection and motivationssbd6985
The document discusses best practices for staff selection and motivation in software companies. It outlines the multi-step selection process companies use, including aptitude tests, interviews, and skills assessments to find both eligible and suitable candidates. It also discusses various motivation theories and strategies companies employ, such as setting goals, providing feedback, designing jobs for variety and responsibility, and enriching jobs through additional tasks and responsibilities. The overall goal is to recruit and retain talented staff through rigorous selection and ongoing motivation.
Information extraction involves acquiring knowledge from text by identifying instances of particular objects and relationships. The simplest approach uses finite-state automata to extract attributes from single objects. More advanced approaches use probabilistic models like hidden Markov models and conditional random fields to extract information from noisy text. Large-scale ontology construction also uses information extraction to build knowledge bases from corpora, focusing on precision over recall and statistical aggregates over single texts. Fully automated systems aim to construct templates and read without human input.
Information extraction involves acquiring knowledge from text by identifying instances of particular objects and relationships. The simplest approach uses finite-state automata to extract attributes from single objects. More advanced approaches use probabilistic models like hidden Markov models and conditional random fields to extract information from noisy text. Large-scale ontology construction also uses information extraction to build knowledge bases from corpora, focusing on precision over recall and statistical aggregates over single texts. Fully automated systems aim to construct templates and read without human input.
Information retrieval systems aim to find documents relevant to a user's information need. Search engines are a common example, allowing users to enter queries and receiving a list of relevant web pages. Effective systems represent documents and queries statistically based on word frequencies and use scoring functions to rank documents by estimated relevance to the query. Evaluation involves measuring a system's precision, the proportion of returned documents that are relevant, and recall, the proportion of all relevant documents that are returned.
Information extraction involves acquiring knowledge from text by identifying instances of particular objects and relationships. The simplest approach uses finite-state automata to extract attributes from single objects. More advanced approaches use probabilistic models like hidden Markov models and conditional random fields to extract information from noisy text. Large-scale ontology construction also uses information extraction to build knowledge bases from corpora, focusing on precision over recall and statistical aggregates over single texts. Fully automated systems that can construct templates and learn from text without human input are an area of research called machine reading.
Information retrieval systems aim to find documents relevant to a user's information need. Search engines are a common example, allowing users to enter queries and receiving a list of relevant web pages. Effective systems represent documents and queries statistically based on word frequencies and use scoring functions to rank documents by estimated relevance to the query. Evaluation involves measuring a system's precision, the proportion of returned documents that are relevant, and recall, the proportion of all relevant documents that are returned.
The document discusses expert systems, which are computer systems that emulate the decision-making ability of a human expert. It describes the typical architecture of an expert system, which includes a knowledge base, inference engine, user interface, explanation facility, and knowledge acquisition system. It provides details on key components like the knowledge base, which stores rules and data, and the inference engine, which applies rules and reasoning to derive conclusions. Specific expert systems are discussed like MYCIN for medical diagnosis, DART for computer fault diagnosis, and XCON for configuring DEC computer systems. The roles of knowledge engineers and domain experts in developing expert systems are also outlined.
Open Source and AI - ByWater Closing Keynote Presentation.pdfJessica Zairo
ByWater Solutions, a leader in open-source library software, will discuss the future of open-source AI Models and Retrieval-Augmented Generation (RAGs). Discover how these cutting-edge technologies can transform information access and management in special libraries. Dive into the open-source world, where transparency and collaboration drive innovation, and learn how these can enhance the precision and efficiency of information retrieval.
This session will highlight practical applications and showcase how open-source solutions can empower your library's growth.
PRESS RELEASE - UNIVERSITY OF GHANA, JULY 16, 2024.pdfnservice241
The University of Ghana has launched a new vision and strategic plan, which will focus on transforming lives and societies through unparalleled scholarship, innovation, and result-oriented discoveries.
This is an introduction to Google Productivity Tools for office and personal use in a Your Skill Boost Masterclass by the Excellence Foundation for South Sudan on Saturday 13 and Sunday 14 July 2024. The PDF talks about various Google services like Google search, Google maps, Android OS, YouTube, and desktop applications.
Odoo 17 Events - Attendees List ScanningCeline George
Use the attendee list QR codes to register attendees quickly. Each attendee will have a QR code, which we can easily scan to register for an event. You will get the attendee list from the “Attendees” menu under “Reporting” menu.
1. Servlet
life cycle of a servlet.
The Servlet API
Handling HTTP Request
Handling HTTP Response
Session Tracking
using Cookies
2. Intro…
– Servlets are small programs that execute on the server side of a
web connection.
– Just as applets dynamically extend the functionality of a web
browser.
– servlets dynamically extend the functionality of a web server.
3. Early days of the Web
– A server could dynamically construct a page by creating a separate process to
handle each client request.
– The process would open connections to one or more databases in order to
obtain the necessary information.
– It communicated with the web server via an interface known as the Common
Gateway Interface (CGI).
– CGI allowed the separate process to read data from the HTTP request and write
data to the HTTP response.
4. Cont.,
– A variety of different languages were used to build CGI programs. These
included C, C++, and Perl.
– CGI suffered serious performance problems.
– It was expensive in terms of processor and memory resources to create a
separate process for each client request.
– It was also expensive to open and close database connections for each
client request.
– In addition, the CGI programs were not platform-independent.
– Therefore, other techniques were introduced. Among these are servlets.
5. Servlets offer several advantages in
comparison with CGI
– First, performance is significantly better. Servlets execute within the address space of a
web server.
– It is not necessary to create a separate process to handle each client request.
– Second, servlets are platform-independent because they are written in Java.
– Third, the Java security manager on the server enforces a set of restrictions to protect
the resources on a server machine.
– Finally, the full functionality of the Java class libraries is available to a servlet. It can
communicate with applets, databases, or other software via the sockets and RMI
mechanisms that you have seen already.
6. The Life Cycle of a Servlet
– Three methods are central to the life cycle of a servlet.
These are:
– init( )
– service( )
– destroy( )
7. User scenario to understand
when these methods are called
– First, assume that a user enters a Uniform Resource Locator (URL) to a web browser.
The browser then generates an HTTP request for this URL. This request is then sent
to the appropriate server.
– Second, this HTTP request is received by the web server. The server maps this
request to a particular servlet. The servlet is dynamically retrieved and loaded into the
address space of the server.
– Third, the server invokes the init( ) method of the servlet. This method is invoked
only when the servlet is first loaded into memory. It is possible to pass initialization
parameters to the servlet so it may configure itself.
8. Cont.,
– Fourth, the server invokes the service( ) method of the servlet. This method is called to
process the HTTP request. the servlet to read data that has been provided in the HTTP
request.
–
– It may also formulate an HTTP response for the client. The servlet remains in the
server’s address space and is available to process any other HTTP requests received
from clients. The service( ) method is called for each HTTP request.
– Finally, the server may decide to unload the servlet from its memory. The algorithms
by which this determination is made are specific to each server. The server calls the
destroy( ) method to relinquish any resources.
9. Using Tomcat for Servlet Development
– To create servlets, you will need access to a servlet
development environment.
– The one used by is Tomcat, Tomcat is an open-source product
maintained by the Jakarta Project of the Apache Software
Foundation.
– It contains the class libraries, documentation, and runtime
support that you will need to create and test servlets.
10. A Simple Servlet
– To become familiar with the key servlet concepts, we will begin by
building and testing a simple servlet. The basic steps are the following:
1. Create and compile the servlet source code. Then, copy the
servlet’s class file to the proper directory, and add the servlet’s
name and mappings to the proper web.xml file.
2. Start Tomcat.
3. Start a web browser and request the servlet.
11. Create and Compile the Servlet Source Code
import java.io.*;
import javax.servlet.*;
public class HelloServlet extends GenericServlet {
public void service(ServletRequest request,ServletResponse
response)
throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter pw = response.getWriter();
pw.println("<B>Hello!</B>");
pw.close();
} }
12. Start Tomcat
– Start Tomcat as explained earlier. Tomcat must be running
before you try to execute a servlet.
– Start a Web Browser and Request the Servlet
– Start a web browser and enter the URL shown here:
http://localhost:8080/servlets-examples/servlet/HelloServlet
– Alternatively, you may enter the URL shown here:
http://127.0.0.1:8080/servlets-examples/servlet/HelloServlet
– This can be done because 127.0.0.1 is defined as the IP address
of the local machine.
13. The Servlet API
– Two packages contain the classes and interfaces that are required to
build servlets. These are:
– javax.servlet
– javax.servlet.http.
– They constitute the Servlet API.
– Keep in mind that these packages are not part of the Java core
packages.
– Instead, they are standard extensions provided by Tomcat.
14. The javax.servlet Package
– The javax.servlet package contains a number of interfaces
and classes that establish the framework in which. The
ServletRequest and ServletResponse interfaces are also
very important:
– Servlet
– ServletConfig
– ServletContext
– ServletRequest
– ServletResponse
15. The following summarizes the core classes that are
provided in the javax.servlet :
–GenericServlet
–ServletInputStream
–ServletOutputStream
–ServletException
–UnavailableException
17. import java.io.*;
import java.util.*;
import javax.servlet.*;
public class PostParametersServlet extends GenericServlet {
public void service(ServletRequest request,ServletResponse response)
throws ServletException, IOException {
PrintWriter pw = response.getWriter();
// Get enumeration of parameter names.
Enumeration e = request.getParameterNames();
// Display parameter names and values.
while(e.hasMoreElements()) {
String pname = (String)e.nextElement();
pw.print(pname + " = ");
String pvalue = request.getParameter(pname);
pw.println(pvalue);
}
pw.close();
}
}
18. Compile the servlet. Next, copy it to the appropriate
directory, and update the web.xml file, as previously
described.
Then, perform these steps to test this example:
1. Start Tomcat (if it is not already running).
2. Display the web page in a browser.
3. Enter an employee name and phone number in the text
fields.
4. Submit the web page.
After following these steps, the browser will display a
response that is dynamically generated by the servlet.
19. The javax.servlet.http Package
– The javax.servlet.http package contains a number of interfaces
and classes that are commonly used by servlet developers.
– You will see that its functionality makes it easy to build servlets
that work with HTTP requests and responses.
– The following table summarizes the core interfaces that are
provided in this package:
Interface Description
HttpSer vletRequest Enables ser vlets to read data from an HTTP request.
HttpSer vletResponse Enables ser vlets to write data to an HTTP response.
HttpSession Allows session data to be read and written.
HttpSessionBindingListener Informs an object that it is bound to or unbound from a
session.
20. Class Description
Cookie Allows state information to be stored on a client machine.
HttpServlet Provides methods to handle HTTP requests and responses.
HttpSessionEvent Encapsulates a session-changed event.
HttpSessionBindingEvent Indicates when a listener is bound to or unbound from a session
value, or that a session attribute changed.
The following table summarizes the core classes that are provided in this package.
The most important of these is HttpServlet. Servlet developers typically extend this
class in order to process HTTP requests.
21. The HttpServletRequest Interface
The HttpServletRequest interface enables a servlet to obtain information about
a client request.
The HttpServletResponse Interface
The HttpServletResponse interface enables a servlet to formulate an HTTP
response to a client. Several constants are defined. These correspond to the different
status codes that can be assigned to an HTTP response.
For example, SC_OK indicates that the HTTP request succeeded,
SC_NOT_FOUND indicates that the requested resource is not available.
The HttpSession Interface
The HttpSession interface enables a servlet to read and write the state
information that is associated with an HTTP session. All of these methods throw an
IllegalStateException if the session has already been invalidated.
22. Handling HTTP Requests and Responses
– The HttpServlet class provides specialized methods that handle the various types of
HTTP requests.
– A servlet developer typically overrides one of these methods. These methods are:
doDelete( )
doGet( )
doHead( )
doOptions( )
doPost( )
doPut( )
doTrace( )
– However, the GET and POST requests are commonly used when handling form input.