JSF 2 Notes with coding examples topics include introduction , managed bean, jsf tags, navigation, jsf life cycle and phase listners,jsf validation and converters, i18n
Hybernat and structs, spring classes in mumbai
best Hybernat and structs, spring classes in mumbai with job assistance.
our features are:
expert guidance by it industry professionals
lowest fees of 5000
practical exposure to handle projects
well equiped lab
after course resume writing guidance
Hibernate 3: Hibernate-What it is ?, ORM and Issues, Hibernate Hello World CRUD, Hello world with Servlet, Hibernate Object life cycle, Hibernate Architecture, Object as Component mapping, Hibernate Inheritance, Hibernate Unidirectional Mapping, Hibernate Bidirectional mapping, HQL, Native SQL queries, Named Quarries
JSF 2 Notes with coding examples topics include introduction , managed bean, jsf tags, navigation, jsf life cycle and phase listners,jsf validation and converters, i18n
Hybernat and structs, spring classes in mumbai
best Hybernat and structs, spring classes in mumbai with job assistance.
our features are:
expert guidance by it industry professionals
lowest fees of 5000
practical exposure to handle projects
well equiped lab
after course resume writing guidance
Hibernate 3: Hibernate-What it is ?, ORM and Issues, Hibernate Hello World CRUD, Hello world with Servlet, Hibernate Object life cycle, Hibernate Architecture, Object as Component mapping, Hibernate Inheritance, Hibernate Unidirectional Mapping, Hibernate Bidirectional mapping, HQL, Native SQL queries, Named Quarries
In this session, we take a look at a handful of the features that will be part of the upcoming Java EE 8 release, as well as a few of the existing features that can be utilized in Java EE 7 today. Each of the features are presented via a recipe in the "Problem", "Solution", and "How it Works" format.
In this Java JSP Training session, you will learn JSP. Topics covered in this session are:
• JSP (Java Server Pages Technology)
• JSP vs Servlet
• MVC Architecture
• Scriplet
For more information, visit this link:
https://www.mindsmapped.com/courses/software-development/jsp-and-servlets-designing-web-applications-with-java/
Enterprise Java Beans (EJB) is a platform for building portable, reusable, and scalable business applications using the Java programming language.
EJB allows application developers to focus on building business logic without having to spend time on building infrastructure code for services such as transactions, security, automated persistence, and so on.
This presentation introduces EJB 3.0 concepts with code examples.
Its an distributed enviornment for developing the enterprise application.We can develop multi-tier,three-tier or n-tier architecture using this.In this Java Server Pages and Servlet is the important things
CETPA INFOTECH PVT LTD is one of the IT education and training service provider brands of India that is preferably working in 3 most important domains. It includes IT Training services, software and embedded product development and consulting services.
http://www.cetpainfotech.com
In this session, we take a look at a handful of the features that will be part of the upcoming Java EE 8 release, as well as a few of the existing features that can be utilized in Java EE 7 today. Each of the features are presented via a recipe in the "Problem", "Solution", and "How it Works" format.
In this Java JSP Training session, you will learn JSP. Topics covered in this session are:
• JSP (Java Server Pages Technology)
• JSP vs Servlet
• MVC Architecture
• Scriplet
For more information, visit this link:
https://www.mindsmapped.com/courses/software-development/jsp-and-servlets-designing-web-applications-with-java/
Enterprise Java Beans (EJB) is a platform for building portable, reusable, and scalable business applications using the Java programming language.
EJB allows application developers to focus on building business logic without having to spend time on building infrastructure code for services such as transactions, security, automated persistence, and so on.
This presentation introduces EJB 3.0 concepts with code examples.
Its an distributed enviornment for developing the enterprise application.We can develop multi-tier,three-tier or n-tier architecture using this.In this Java Server Pages and Servlet is the important things
CETPA INFOTECH PVT LTD is one of the IT education and training service provider brands of India that is preferably working in 3 most important domains. It includes IT Training services, software and embedded product development and consulting services.
http://www.cetpainfotech.com
Java is a general-purpose computer-programming language that is concurrent, class-based, object-oriented, and specifically designed to have as few implementation dependencies as possible.
presentation on online movie ticket bookingdharmawath
The goals of our system are:
To provide a anytime anyplace service for the customer
To minimize the number of staff at the ticket box
To promote the film on the internet
To increase the profit
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...Amil Baba Dawood bangali
Contact with Dawood Bhai Just call on +92322-6382012 and we'll help you. We'll solve all your problems within 12 to 24 hours and with 101% guarantee and with astrology systematic. If you want to take any personal or professional advice then also you can call us on +92322-6382012 , ONLINE LOVE PROBLEM & Other all types of Daily Life Problem's.Then CALL or WHATSAPP us on +92322-6382012 and Get all these problems solutions here by Amil Baba DAWOOD BANGALI
#vashikaranspecialist #astrologer #palmistry #amliyaat #taweez #manpasandshadi #horoscope #spiritual #lovelife #lovespell #marriagespell#aamilbabainpakistan #amilbabainkarachi #powerfullblackmagicspell #kalajadumantarspecialist #realamilbaba #AmilbabainPakistan #astrologerincanada #astrologerindubai #lovespellsmaster #kalajaduspecialist #lovespellsthatwork #aamilbabainlahore#blackmagicformarriage #aamilbaba #kalajadu #kalailam #taweez #wazifaexpert #jadumantar #vashikaranspecialist #astrologer #palmistry #amliyaat #taweez #manpasandshadi #horoscope #spiritual #lovelife #lovespell #marriagespell#aamilbabainpakistan #amilbabainkarachi #powerfullblackmagicspell #kalajadumantarspecialist #realamilbaba #AmilbabainPakistan #astrologerincanada #astrologerindubai #lovespellsmaster #kalajaduspecialist #lovespellsthatwork #aamilbabainlahore #blackmagicforlove #blackmagicformarriage #aamilbaba #kalajadu #kalailam #taweez #wazifaexpert #jadumantar #vashikaranspecialist #astrologer #palmistry #amliyaat #taweez #manpasandshadi #horoscope #spiritual #lovelife #lovespell #marriagespell#aamilbabainpakistan #amilbabainkarachi #powerfullblackmagicspell #kalajadumantarspecialist #realamilbaba #AmilbabainPakistan #astrologerincanada #astrologerindubai #lovespellsmaster #kalajaduspecialist #lovespellsthatwork #aamilbabainlahore #Amilbabainuk #amilbabainspain #amilbabaindubai #Amilbabainnorway #amilbabainkrachi #amilbabainlahore #amilbabaingujranwalan #amilbabainislamabad
Immunizing Image Classifiers Against Localized Adversary Attacksgerogepatton
This paper addresses the vulnerability of deep learning models, particularly convolutional neural networks
(CNN)s, to adversarial attacks and presents a proactive training technique designed to counter them. We
introduce a novel volumization algorithm, which transforms 2D images into 3D volumetric representations.
When combined with 3D convolution and deep curriculum learning optimization (CLO), itsignificantly improves
the immunity of models against localized universal attacks by up to 40%. We evaluate our proposed approach
using contemporary CNN architectures and the modified Canadian Institute for Advanced Research (CIFAR-10
and CIFAR-100) and ImageNet Large Scale Visual Recognition Challenge (ILSVRC12) datasets, showcasing
accuracy improvements over previous techniques. The results indicate that the combination of the volumetric
input and curriculum learning holds significant promise for mitigating adversarial attacks without necessitating
adversary training.
About
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
• Remote control: Parallel or serial interface.
• Compatible with MAFI CCR system.
• Compatible with IDM8000 CCR.
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
• Easy in configuration using DIP switches.
Technical Specifications
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
Key Features
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
• Remote control: Parallel or serial interface
• Compatible with MAFI CCR system
• Copatiable with IDM8000 CCR
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
Application
• Remote control: Parallel or serial interface.
• Compatible with MAFI CCR system.
• Compatible with IDM8000 CCR.
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
• Easy in configuration using DIP switches.
Overview of the fundamental roles in Hydropower generation and the components involved in wider Electrical Engineering.
This paper presents the design and construction of hydroelectric dams from the hydrologist’s survey of the valley before construction, all aspects and involved disciplines, fluid dynamics, structural engineering, generation and mains frequency regulation to the very transmission of power through the network in the United Kingdom.
Author: Robbie Edward Sayers
Collaborators and co editors: Charlie Sims and Connor Healey.
(C) 2024 Robbie E. Sayers
Water scarcity is the lack of fresh water resources to meet the standard water demand. There are two type of water scarcity. One is physical. The other is economic water scarcity.
3. Advance Java
• Java Core
▫ Genesis of Java
• Lesson 3: Name
▫ Provide brief description, if desired.
4. Lesson 1: Genesis Of Java
• Java’s Creator – James Gosling
• Why Java is so important to Internet ?
• Java’s Magic : The Bytecode
• The Java Buzzwords
5. Quick Walkthrough of Java Core
• Data Types, Variables, Arrays,
Operators, Classes, Methods,
Inheritence
• Packages, Interfaces, Exception
Handling, I/O Applets and Networking
Basics, Collection Framework
• Event Handling, AWT and Swing
6. Java Core : Wrap-up
Few miscellaneous features of Java’s Core to be noted are :-
• Java is a strongly typed language
• Java’s Primitive data types – Default Values and size
• Java’s Automatic Conversion
• The this keyword
• Garbage Collection ( Java’s Destructor !! )
• Argument passing – Call By Value and Call By Reference
• Using super to access hidden data
• Object Class
• Packages it’s importance and where does Java looks for user defined packages. Role
of Access Specifier in Packages
• Java’s extend keyword only support single inheritance. Other forms of inheritance
could be achieved through interfaces
7. Java Core : Wrap-up
• Interfaces – dynamic lookup of a method.
• Exception handling – Try, Catch, throw, throws,
finally. Super class – Throwable. It’s sub class –
Exception and Error
• Thread Synchronization
• Collection Framework – D/f Interfaces
• Swing Using Net Beans IDE.
8. Lesson 2: JEEE – What is it ????
• What Is the Java 2 Enterprise Edition (J2EE)?
Depending upon whom you ask, Java 2 Enterprise Edition
(J2EE) is oneof many things :-
• Web components such as JSPs, Servlets, or Web
Archives.
• EJB components, which are Java Archives containing EJB
code and the deployment descriptor.
• Client applications, which are stand-alone Java
executable.
9. Archives, Descriptor and manifest
• Descriptors provide configuration information ,environment
settings, role-based security, and vendor-specific information.
• The manifest is a packing slip that is automatically generated by
the archive process.
• 1. Java Archives (JAR)—A JAR file encapsulates one or more Java
• classes, a manifest, and a descriptor. JAR files are the lowest
• level of archive. JAR files are used in J2EE for packaging EJBs
• and client-side Java Applications.
• 2. Web Archives (WAR)—WAR files are similar to JAR files, except
• that they are specifically for web applications made from
• Servlets, JSPs, and supporting classes.
• 3. Enterprise Archives (EAR)—An EAR file contains all of the
• components that make up a particular J2EE application.
10. Introduction to J2EE Enterprise Architecture
J2EE Enterprise
Architecture
Enterprise Applications CE00465-M
The Web Tier
Servlets
11. J2EE Enterprise
Architecture
Enterprise Applications CE00465-M
J2EE Architecture
• Multi-tiered, distributed application model
• Component based
• Unified security model
• Flexible transaction control
• Web services support
• Open systems development - not tied into one vendor
14. J2EE Enterprise
Architecture
Enterprise Applications CE00465-M
J2EE Components
• A component is a self-contained functional software unit that is
assembled into a J2EE application with its related classes and files and
that communicates with other components.
• Application clients and applets are components that run on the client.
• Java Servlets and JavaServer Pages™ (JSP™) technology components are
Web components that run on the server.
• Enterprise JavaBeans™ (EJB™) components (enterprise beans) are
business components that run on the server.
15. J2EE Enterprise
Architecture
Enterprise Applications CE00465-M
J2EE Components
• Application client
▫ Web client
Consists of two parts: (1) dynamic web pages containing various types of markup language
(HTML, XML, and so on), which are generated by web components running in the server’s web
tier, and (2) a web browser, which renders the pages received from the server
▫ Applets
A web page received from the web tier can include an embedded applet. An applet is a small
client application written in the Java programming language that executes in the Java virtual
machine (JVM) installed in the web browser
▫ Application client
An application client runs on a client machine and provides a way for users to handle tasks that
require a richer user interface than can be provided by a mark up language. It typically has a
graphical user interface (GUI) created from Java’s Swing or AWT APIs, but a command-line
interface is also possible
16. J2EE Enterprise
Architecture
Enterprise Applications CE00465-M
J2EE Components
• JavaBeans Components
▫ Application may include JavaBeans
▫ Have properties, get- and set- methods
▫ Not considered J2EE components by the J2EE specification
• J2EE Web Components
▫ Either Servlets or JSP pages
Servlets are Java programming language classes that dynamically process requests and
construct responses.
JavaServer Pages are text-based documents that execute as servlets but allow a more natural
approach to creating static content.
• Business Components (Enterprise JavaBeans)
▫ Business code, which is logic that solves or meets the needs of a particular business
domain such as banking is handled by enterprise beans running in the business tier.
17. J2EE Enterprise
Architecture
Enterprise Applications CE00465-M
The Different Components
Web browser
Dynamic web pages
Applet & optional
JavaBeans
components
Application Client
JavaServer
Pages
Servlets
JavaBeans
components
(optional)
Entity Beans
Session Beans
Message-driven
Beans
Database
and Legacy
Systems
Web Tier Business Tier
Client Tier
J2EE Server (Container)
18. J2EE Enterprise
Architecture
Enterprise Applications CE00465-M The Different Containers
Applet Container
Web browser
Java Plug-in
J2EE Server (Container)
JavaServer
Pages
Servlets
Entity Beans
Session Beans
Message-driven
Beans
Database
and Legacy
Systems
Web Container
EJB Container
Application client
Application client
Container
19. J2EE Enterprise
Architecture
Enterprise Applications CE00465-M
Containers and Server-side Technologies
• A container is a runtime service provides the interface between components and
the low-level functionality that supports the component
• A container manages components that have been developed according to the API
specifications
• We shall use Sun’s Java System Application Server as our J2EE container. It provides
both a web container (for servlets and JSPs) and an EJB container (for enterprise
beans)
• Servlets and JSPs are server-side technologies that accept HTTP requests from an
HTML form and return responses in the form of HTML, XHTML or XML documents
• At runtime, servlets and JSPs are equivalent: You could write an application just
using servlets or just using JSPs or you could mix them up; we’ll have a look later at
a suitable policy for choosing when to use servlets or JSPs
20. J2EE Enterprise
Architecture
Enterprise Applications CE00465-M
Servlet interface
• Architecturally all servlets must implement the servlet interface
• The methods of the Servlet interface are invoked automatically by the servlet container
• The interface has five methods
• void init(ServletConfig config)
▫ This method is called once during the servlet’s execution cycle to initialise the servlet (the argument is supplied by the
container)
• ServletConfig getServletConfig()
▫ Returns an object reference to an object that implements interface ServletConfig (provides access to servlet configuration
information as well as information about it’s environment (the container)
• String getServiceInfo()
▫ Returns information such as the servlet’s author and version
• void service(ServletRequest request, ServletResponse response)
▫ This method is called as a result of a client request
• void destroy()
▫ Clean up method called when the servlet is destroyed by it’s container
21. Servlet’s lifecycle - UML state diagram
Instantiation based on
a request or at
container start up
Does not exist Instantiated
Initialisation
Initialisation failed
Unavailable Initialised and/or
Ready for requests
Back to service
In case of temporary
unavailability
HTTP request(s)
From client(s)
Destroyed Service
End of
Service
Temporary or permanent thread
failure
Time out or container shutdown
22. J2EE Enterprise
Architecture
Enterprise Applications CE00465-M
HttpServlet class
• Web-based servlets typically extend the HttpServlet class
• HttpServlet is an abstract class that must be extended to create an HTTP
servlet suitable for a Web site. A subclass of HttpServlet must override at
least one method, usually one of these:
▫ doGet() – if the servlet is to support HTTP GET requests
▫ doPost() – for HTTP POST requests
▫ doPut() – for HTTP PUT requests
▫ doDelete() – for HTTP DELETE requests
▫ init() and destroy() – to manage resources that are held for the life of
the servlet
▫ getServletInfo() – if the servlet is to provide information about itself
• There's almost no reason to override the service method, which handles
standard HTTP requests by dispatching them to the handler methods for each
HTTP request type (the doXXX methods listed above).
23. J2EE Enterprise
Architecture
Enterprise Applications CE00465-M
doGet() and doPost() methods
• doGet(HttpServletRequest req, HttpServletResponse resp)
▫ Processes an HTTP GET request; e.g. to retrieve the contents of a specified URL (an HTML
or XHTML or XML page)
▫ The response content can be generated dynamically by the servlet
▫ URL can be typed into a browser’s address or Location field and can be bookmarked
• doPost(HttpServletRequest req, HttpServletResponse resp)
▫ Processes an HTTP POST request; typically used to post data from an HTML form to a
server-side form handler that processes the data (save it in a database or retrieve data
from the database.)
▫ Cannot be typed into a browser’s address or Location field and cannot be bookmarked
▫ an HTTP POST request does not have a restriction on the amount of data transmitted
• Safer to use doPost() method!
▫ Except if you’re using a servlet to display information without an associated html page –
then use doGet() method
24. J2EE Enterprise
Architecture
Enterprise Applications CE00465-M
Simple example using doGet() method
• On the Client side we need:
▫ An HTML client; e.g. a web browser
• On the server side we need:
▫ A servlet with a doGet() method
▫ A web.xml file that relates the servlet’s URL to the servlet’s Java class
Usually this is generated for you by the IDE (NetBeans in this case)
25. The web client
<html>
<head>
<title>HelloServlet</title>
</head>
<body>
<form action="hello" method="get">
<p>press Submit to invoke servlet HelloServlet</p>
<p><input type="submit" name="Submit" value="Submit"></p>
</form>
</body>
</html>
• This file is called index.html
• Note the form tags
▫ The form’s action attribute specifies the servlet’s URL, i.e. hello
J2EE Enterprise Architecture Enterprise Applications CE00465-M
26. J2EE Enterprise
Architecture
Enterprise Applications CE00465-M
<web-app>
web.xml
<display-name>HelloWorld</display-name>
<servlet>
<servlet-name>helloservlet</servlet-name>
<servlet-class>entapps.HelloServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>helloservlet</servlet-name>
<url-pattern>/hello</url-pattern>
</servlet-mapping>
</web-app>
• Note for each servlet you need two tags
▫ <servlet>
▫ <servlet-mapping>
28. J2EE Enterprise
Architecture
Enterprise Applications CE00465-M
Running in NetBeans
• In NetBeans you need to build the project, then deploy the project and finally run
the project. If you choose the run option then NetBeans will automatically build,
deploy and run the project.
• Once the application is deployed and run you see the following URL in a web
browser (assuming you called the project SimpleServlet)
▫ http://localhost:8080/SimpleServlet/
▫ When you hit the submit button Hello World is displayed and the URL becomes
▫ http://localhost:8080/SimpleServlet/hello?Submit=Submit
• If you changed the doGet() method to a doPost() method and submit the form the
URL becomes
▫ http://localhost:8080/SimpleServlet/hello
▫ You can’t see the input parameters
▫ If you bookmark it then you can’t retrieve the URL
29. J2EE Enterprise
Architecture
Enterprise Applications CE00465-M Adding in request parameters
• If you wanted to add in the name of the user in the html page
and display it in the servlets, we would add in
UserID:<input type ="text" name = "requsername" >
in the html file
and
out.println("<p>from"+request.getParameter("requsername"));
in the servlet
• Sometimes you may want to hide the request parameter from
the user (but still visible when you choose view source from
within the browser)
▫ Set the type attribute to “hidden”
<input type = "hidden" name = "action" value
="entryform">
▫ This will be hidden from the user, you can use it in the servlet by
String action =
request.getParameter("action");
30. J2EE Enterprise
Architecture
Enterprise Applications CE00465-M
Initialising Servlets
• Common in real-life servlets
▫ E.g. initialising database connection pools
• Use SevletConfig.getInitParameters() to read initialisation parameters
▫ Call getServletConfig() to obtain the ServletConfig object
• Set initialisation parameters in web.xml
• It is common to use the init() method even when you don’t read
initialisation parameters
▫ e.g. to set up data structures that don’t change during the life cycle of the
servlet, to load information from disk, etc.
32. J2EE Enterprise
Architecture
Enterprise Applications CE00465-M
Example of Initialising parameters
public void doPost(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException
{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
ServletConfig config = getServletConfig();
out.println("<html>");
out.println("<head><title>HelloServlet</title></head>");
out.println("<body bgcolor="lightblue">");
out.println("<p>Hello World.</p>");
out.println("<p>from " + request.getParameter("requsername"));
out.println("<p>and from " +
config.getInitParameter("defaultusername") +
"the default user");
out.println("</body></html>");
}
33. J2EE Enterprise
Architecture
Enterprise Applications CE00465-M
Request Headers
• Every request has header information associated with it e.g. whether
the request is a post or get request, the protocol associated with the
request, etc. The request object has methods associated to display
these headers . Below is a servlet that prints these headers out for a
particular request
public class ShowRequestHeaders extends HttpServlet
{
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException
{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
String title = "Servlet Example: Showing Request Headers";
36. J2EE Enterprise
Architecture
Enterprise Statelessness and Sessions Applications CE00465-M
• HTTP is a stateless protocol
▫ Each request from a client is treated in isolation from all
other requests from the same client i.e. there is no
relationship between the different requests
▫ A protocol is stateful if the response to a given request may
depend not only on the current request but also on the
outcome of previous requests
• Stateful is important
▫ With on-line banking you only need to register once
e.g. looking at your balances, or transferring money from
one account to another doesn’t require you to re-register for
every request
▫ Internet shopping with a shopping cart
• Session
▫ The server should be able to identify that a series of requests
from a single client form a single working session
• State
▫ The server should be able to remember information related
to previous requests in a single session
37. J2EE Enterprise
Architecture
Enterprise Applications CE00465-M
Session Tracking with the Java Servlet API
• The javax.servlet.http.HttpSession interface encapsulates the notion of a
session
▫ The request object provides the getSession() method which gives you access to
the HttpSession object associated with the client making the request
▫ The HttpSession object is an implicit object and is created for each client by the
web container
▫ The web container maintains this object for the duration of the client session
▫ Each session consumes memory on the server-side, so it’s unwise to keep
sessions open forever
Most e-commerce sites limit this interval to less than 30 minutes
You can specify the session limit time in the web.xml file using a deployment
descriptor element <session-config>
38. J2EE Enterprise
Architecture
Enterprise Applications CE00465-M
Session Methods for Managing State
• setAttribute() method
▫ public setAttribute(String name, Object attribute)
Binds an object to this session, using the name specified
• getAttribute() method
▫ public Object getAttribute(String name)
This method returns the attribute bound with the specified name in this session, or null if no
object is bound under the name
• getAttributeNames() method
▫ public Enumeration getAttributeNames(String name)
Returns an Enumeration of String objects containing the names of all the objects bound to this
session.
• removeAttribute() method
▫ public void removeAttribute(String name)
Removes the object bound with the specified name from this session.
39. J2EE Enterprise
Architecture
Enterprise Applications CE00465-M
Using the state management methods
String un = request.getParameter("username");
request.getSession().setAttribute("user", un);
String un=(String)request.getSession().getAttribute("user");
40. J2EE Enterprise
Architecture
Enterprise Applications CE00465-M
Request Dispatching
• Allows a servlet or a JSP page to dispatch a request to an HTML page, or another
servlet or JSP page, which will then be responsible for any further processing and for
generating the response.
• The request object has an interface for this purpose: javax.servlet.RequestDispatcher
• The request dispatcher object has two methods which allow delegation of the
request-response processing to another resource after the dispatching servlet has
finished any preliminary processing
▫ public void forward(ServletRequest req, ServletResponse resp) throws ServletException,
java.io.IOException)
Allows the request to be forwarded to another servlet or JSP page which then assumes all
responsibility for producing the response
▫ public void include(ServletRequest req, ServletResponse resp) throws ServletException,
java.io.IOException)
Allows the inclusion of the content produced by another resource in the dispatching servlet’s
response
42. J2EE Enterprise
Architecture
Enterprise Applications CE00465-M
Examples of Request Dispatching
• oracleconnection is the name of a servlet,
OracleConnection.java
▫ Specified in web.xml
<servlet>
<servlet-name>oracleconnection</servlet-name>
<servlet-class>entapps.OracleConnection</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>oracleconnection</servlet-name>
<url-pattern>/oracleconnection</url-pattern>
</servlet-mapping>
43. Examples of Request Dispatching
• Status is the name of an attribute that OracleConnection sets to either “OK” or “fail”
• public void sendRedirect(java.lang.String location) throws java.io.IOException
▫ Sends a temporary redirect response to the client using the specified redirect
location URL. This method can accept relative URLs; the servlet container must
convert the relative URL to an absolute URL before sending the response to the
client. If the location is relative without a leading '/' the container interprets it as
relative to the current request URI. If the location is relative with a leading '/' the
container interprets it as relative to the servlet container root. (source
java.sun.com)
• viewerror is the name of a Servlet specified in web.xml.