PPT Unit 3 J2EE and Web Development-265689
PPT Unit 3 J2EE and Web Development-265689
Client power.
Drawbacks
Easier upgrading
Easier support
But:
Our requirements have increased
Where is our RAD?
Modern Application
Needs
J2EE is a set of specifications, which define the standard for developing multi-
tier enterprise applications with Java. The J2EE platform provides a complete
framework for design, development, assembly, and deployment of Java
applications built on multi-tiered distributed application model.
J2EE Features:-
Component based model
Container provided services
Highly Scalable
Simplified Architecture
Flexible security model
J2EE Components
J2EE application components
JavaBeans are classes that encapsulate many objects into a single object (the
bean). They are serializable, have a zero-argument constructor, and allow access
to properties using getter and setter methods. The name "Bean" was given to
encompass this standard, which aims to create reusable software components
for Java.
Enterprise JavaBeans (EJB) is one of several Java APIs for modular construction
of enterprise software. EJB is a server-side software component that
encapsulates business logic of an application. An EJB web container provides a
runtime environment for web related software components
J2EE architecture
J2EE Containers
• What is container ?
Containers are the interface between a component and the low-level platform-
specific functionality that supports the component. Before a web component,
enterprise bean, or application client component can be executed, it must be
assembled into a J2EE module and deployed into its container.
The runtime portion of a J2EE product. A J2EE server provides EJB and
web containers.
• Enterprise JavaBeans (EJB) container
Manages the execution of enterprise beans for J2EE applications. Enterprise beans and
their container run on the J2EE server.
• Web container
Manages the execution of JSP page and servlet components for J2EE applications. web
components and their container run on the J2EE server.
• Application client container
Manages the execution of application client components. Application clients and their
container run on the client.
• Applet container
Manages the execution of applets. Consists of a web browser and Java Plug-in running on
the client together.
Web container
Apache Tomcat (formerly Jakarta Tomcat) is an open source web container
available under the Apache Software License.
Apache Geronimo is a full Java EE 6 implementation by Apache Software
Foundation.
Enhydra, from Lutris Technologies.
GlassFish from Oracle (an application server, but includes a web container).
Jetty, from the Eclipse Foundation.
Jaminid contains a higher abstraction than servlets.
Payara is another application server, derived from Glassfish.
Winstone supports specification v2.5 as of 0.9, has a focus on minimal
configuration and the ability to strip the container down to only what you need.
Tiny Java Web Server (TJWS) 2.5 , small footprint, modular design.
Virgo from Eclipse Foundation provides modular, OSGi based web containers
implemented using embedded Tomcat and Jetty. Virgo is available under the
Eclipse Public License.
WildFly (formerly JBoss Application Server) is a full Java EE implementation by
Red Hat, division JBoss.
Applications Servers
For Web applications, these components are usually performed in the same
running environment as their web server(s), and their main job is to support the
construction of dynamic pages. However, many application servers target much
more than just Web page generation: they implement services like clustering, fail-
over, and load-balancing, so developers can focus on implementing the business
logic.
Types of Servers in J2EE
Applications
So now we have established what an Application server is, we will now take a look
at the available Java Application Servers.
Glassfish. ...
JBoss Enterprise Application Platform. ...
Wildfly. ...
Apache Tomcat. ...
Apache TomEE. ...
JOnAS. ...
Resin Servlet Container (Open Source) ...
Blazix.
Hypertext Transfer Protocol
One of the most commonly used services on the Internet is the World Wide Web
(WWW). The application protocol that makes the web work is Hypertext
Transfer Protocol or HTTP.
Do not confuse this with the Hypertext Markup Language (HTML). HTML is the
language used to write web pages. HTTP is the protocol that web browsers and
web servers use to communicate with each other over the Internet.
It is an application level protocol because it sits on top of the TCP layer in the
protocol stack and is used by specific applications to talk to one another. In this
case the applications are web browsers and web servers.
When you type a URL into a web browser, this is what happens:
1. If the URL contains a domain name, the browser first connects to a domain
name server and retrieves the corresponding IP address for the web server.
2. The web browser connects to the web server and sends an HTTP request (via
the protocol stack) for the desired web page.
3. The web server receives the request and checks for the desired page. If the
page exists, the web server sends it. If the server cannot find the requested
page, it will send an HTTP 404 error message. (404 means 'Page Not Found' as
anyone who has surfed the web probably knows.)
4. The web browser receives the page back and the connection is closed.
Hypertext Transfer Protocol
5. The browser then parses through the page and looks for other page elements it
needs to complete the web page. These usually include images, applets, etc.
6. For each element needed, the browser makes additional connections and HTTP
requests to the server for each element.
7. When the browser has finished loading all images, applets, etc. the page will be
completely loaded in the browser window.
HTTP & Application
Programming Interface
• Web API
• Remote API
Web API
Web API is a framework for building HTTP services that can be consumed by a broad
range of clients including browsers, mobiles, iphone and tablets almost same as web
services. Web API is typically done as HTTP/REST, nothing is defined, output can be
eg. JSON/XML, input can be XML/JSON/or plain data.
For example, the Java Database Connectivity (JDBC) API allows developers to query
many different types of databases with the same set of functions, while the Java
remote method invocation API uses the Java Remote Method Protocol to allow
invocation of functions that operate remotely, but appear local to the developer.
Therefore, remote APIs are useful in maintaining the object abstraction in object-
oriented programming; a method call, executed locally on a proxy object, invokes the
corresponding method on the remote object, using the remoting protocol, and
acquires the result to be used locally as return value.
Web Application
architecture
Models Application
Model
• Model 1
• Model 2 (MVC) Architecture
Models 1 Architecture
As you can see in the above figure, there is picture which show the flow of
the model1 architecture.
• Time consuming You need to spend more time to develop custom tags in
JSP. So that we don't need to use scriptlet tag.
• Hard to extend. It is better for small applications but not for large
applications.
Models 2 MVC
Architecture
Model 2 is based on the MVC (Model View Controller) design pattern. The MVC
design pattern consists of three modules model, view and controller.
Model The model represents the state (data) and business logic of the application.
View The view module is responsible to display data i.e. it represents the
presentation.
• We need to write the controller code self. If we change the controller code,
we need to recompile the class and redeploy the application.
End OF Unit