Introduction To Enterprise Java Bean(EJB). Developing web component.
Developing web component
Introduction To Java Beans
J2EE specification defines the structure of a J2EE application. According to the specification J2EE application consists of
Tutorial Details:
two components, web component and the enterprise bean.
Web component consists of all the programs and the files used to provide the user interface and these may contain JSP, Servlets, images, html files etc. These files are archived into .war file and deployed on the web server.
Enterprise Bean consists of all the program necessary to provide the business to the application. These files are archived into .jar file and are deployed on the application server such as WebLogic 6.0.
You can deploy the web component and the ejb components separately on the web server and the application server respectively. J2EE specification also provide a way to package these files into one archive .ear file and then deploy on the server.
Writing and deploying the web component
In this section we are going to describe you how to write and deploy the web component on the WebLogic 6.0 web server.
Web component follows the standard directory structure defined in the J2EE specification.
Directory Structure of Web Component
/
index.htm, JSP, Images etc..
Web-inf
web.xml
classes
servlet classes
lib
jar files
Root directory of the web archive ('.war' file) contains all the html, jsp, images files and the additional directories containing these files. In the root directory there is a special directory 'Web-inf' which contains the web deployment descriptor (web.xml), classes and the lib directory.
To download the code for this lesson click here . To deploy this web component download the code and then extract it in you favorite directory. One directory will be created with the name of lesson1, go to the leson1 directory and to create the war file issue the following command from dos prompt:
c:\mydir\lesson1 > jar cf lesson1.war *
Web component file with the name of lesson1.war will be created. You can deploy it to the WebLogic 6.0 server using console. After deploying it using the WebLogic 6.0's console type http://localhost:7001/lesson1/ to view. Server will serve index.jsp to your browser.
Now let's see the web.xml file which describes the content of the web component. Here is the content of web.xml file.
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">
index.jsp
54
web.xml file start with xml declaration and after the document type declaration tag starts. All the information regarding the content of the .war file are written between and tags in the xml format.
In the first lesson we are setting index.jsp as our welcome page and the following lines of the web.xml file is used to accomplish this.
index.jsp
and the following code sets the session time:
54
To learn more about writing the web.xml file and deploying the web application on WebLogic 6.0 please visit:
http://e-docs.bea.com/wls/docs60/adminguide/config_web_app.html
In the next lesson we will write stateless session bean and then deploy on the WebLogic 6.0 Server.
Rate Tutorial: http://www.roseindia.net/javabeans/webcomponent.shtml
Read
Tutorial at: Click here to view the tutorial
Rate Tutorial: Introduction To Enterprise Java Bean(EJB). Developing web component.
View Tutorial: Introduction To Enterprise Java Bean(EJB). Developing web component.
Related
Tutorials:
The state of Java middleware, Part II: Enterprise JavaBeans - JavaWorld - April
1999
The state of Java middleware, Part II: Enterprise JavaBeans - JavaWorld - April
1999 |
Create forward-compatible beans in EJB,
Part 1 - JavaWorld December
1999
Create forward-compatible beans in EJB,
Part 1 - JavaWorld December
1999 |
Create forward-compatible beans in EJB,
Part 2 - JavaWorld January
2000
Create forward-compatible beans in EJB,
Part 2 - JavaWorld January
2000 |
Read all about EJB 2.0 - JavaWorld June
2000
Read all about EJB 2.0 - JavaWorld June
2000 |
Programming restrictions on EJB - JavaWorld August 2000
Programming restrictions on EJB - JavaWorld August 2000 |
Brewing entity
Enterprise JavaBeans - JavaWorld September
2000
Brewing entity
Enterprise JavaBeans - JavaWorld September
2000 |
Get the app out - JavaWorld January 2001
Get the app out - JavaWorld January 2001 |
The art of EJB deployment - JavaWorld August 2001
The art of EJB deployment - JavaWorld August 2001 |
Integrate security infrastructures with JBossSX
Integrate security infrastructures with JBossSX |
Accelerate EJB 2.0
development with EJBGen
Accelerate EJB 2.0
development with EJBGen |
Container-managed relations for the
21st century
Container-managed relations for the
21st century |
The J2EE 1.4 Tutorial
The J2EE 1.4 Tutorial is a guide to developing enterprise applications for the Java 2 Platform, Enterprise Edition (J2EE) version 1.4. Here we cover all the things you need to know to make the best use of this tutorial. |
Add concurrent processing with message-driven beans
Add concurrent processing with message-driven beans |
Turn EJB components into Web services
Summary
Web services have become the de facto standard for communication among applications. J2EE 1.4 allows stateless Enterprise JavaBeans (EJB) components to be exposed as Web services via a JAX-RPC (Java API for XML Remote Procedure Call) endpoint, al |
Testing Your Enterprise JavaBeans with Cactus
Enterprise JavaBeans provide many advantages. But each server-side/back-end developer knows that development of EJBs is sometimes painful, time-consuming, and requires a lot of patience while creating assembly descriptors, application-server-specific conf |
Developing Distributed application using Enterprise Java Beans, J2EE Architecture, EJB Tutorial, WebLogic Tutorial.
Developing Distributed application using Enterprise Java Beans, J2EE Architecture, EJB Tutorial, WebLogic Tutorial.
Distributed Architecture
Two-tier application:
In the past two-tier applications were used. Two-tier applications are also know as |
Introduction To Enterprise Java Bean(EJB). WebLogic 6.0 Tutorial.
Introduction To Enterprise Java Bean(EJB). WebLogic 6.0 Tutorial.
Welcome to EJB Section
(Learn to Develop World Class Applications with Enterprise Java Beans)
(Online WebLogic 6.0 Tutorial)
Introduction To Enterprise Java Bean(EJB)
Enterprise |
Introduction To Enterprise Java Bean(EJB). Developing web component.
Introduction To Enterprise Java Bean(EJB). Developing web component.
Developing web component
Introduction To Java Beans
J2EE specification defines the structure of a J2EE application. According to the specification J2EE application consists of |
developing a Session Bean and a Servlet and deploy the web application on
JBoss 3.0
developing a Session Bean and a Servlet and deploy the web application on JBoss 3.0
Writing Calculator Session Bean and Calling through JSP
Previous Tutorial Index Next
In this lesson I will show you how to develop a Calculator Stateless Session |
developing a Session Bean and a Servlet and deploy the web application on
JBoss 3.0
developing a Session Bean and a Servlet and deploy the web application on JBoss 3.0
Writing Stateless Session Bean and Calling through Servlet
Previous Tutorial Index Next
In this lesson I will show you how to develop a Stateless Session Bean and |
|
|
|