Patient Billing System
Patient Billing System
Patient Billing System
INDEX
1. Introduction
2. System Analysis
a. Existing System
b. proposed System
3. Feasibility Report
a. Technical Feasibility
b. Operational Feasibility
c. Economical Feasibility
a. Overview
b. Modules Description
c. Process Flow
d. SDLC Methodology
e. Software Requirements
f. Hardware Requirements
5. System Design
a. DFD
b. E-R diagram
c. UML
d. Data Dictionary
6. Technology Description
7. Coding
9. Output Screens
10. Reports
12. Conclusion
13. Bibliography
INTRODUCTION
This project is aimed at developing a patient billing software system that is of
importance to a hospital. The PBS is a local software system. This system can
be used to maintain the location (bed no.) of each patient either in the ward
or the ICU. Information about the patient and the charges to be paid is also
stored.
The development of this new system contains the following activities, which
try to automate the entire process keeping in the view of database
integration approach.
• The manual system gives us very less security for saving data;
some data may be lost due to mismanagement.
EXISTING SYSTEM
The development of this new system contains the following activities, which
try to automate the entire process keeping in the view of database
integration approach.
• This system can provide the information about the patient based
on the ward number whether the patient is either in the general
ward or the ICU.
• We can keep a track of all beds occupied / free in both the ward
and the ICU by using this system.
ECONOMIC FEASIBILITY:
NUMBER OF MODULES
1. Administrator
2. Employee (Receptionist)
3. Payment Module
5. Reports
MODULES DESCRIPTION
Administrator:
Employee:
This module is dealing with the details of all patients details, their
admit time and the amount to be paid based on the treatment given
and the ward selected. We can also view the patient details like
amount to be paid / any balance remaining, the ward number, the bed
number, the registration number, case number etc. Keep a track of all
beds occupied / free in both the ward and the ICU. Keep a track of all
transfers of patients from the general ward to the ICU and vice versa.
Payment Module :
2. Change password
3. Forgot Password
Reports:
Model-2 Architecture.
SDLC METHDOLOGIES
SDLC METHDOLOGIES
This document play a vital role in the development of life cycle (SDLC) as it
describes the complete requirement of the system. It means for use by
developers and will be the basic during testing phase. Any changes made to
the requirements in the future will have to go through formal change
approval process.
SPIRAL MODEL was defined by Barry Boehm in his 1988 article, “A spiral
Model of Software Development and Enhancement. This model was not the
first model to discuss iterative development, but it was the first model to
explain why the iteration models.
• At the customer option, the entire project can be aborted if the risk
is deemed too great. Risk factors might involve development cost
overruns, operating-cost miscalculation, or any other factor that
could, in the customer’s judgment, result in a less-than-satisfactory
final product.
• The preceding steps are iterated until the customer is satisfied that
the refined prototype represents the final product desired.
• Software engineers can get their hands in and start woring on the
core of a project earlier.
SOFTWARE REQUIREMENT & HARDWARE
REQUIREMENT
Software Requirements :
Hardware Requirements:
Processor : Pentium IV
A graphical tool used to describe and analyze the moment of data through a
delays in the system. Data Flow Diagrams are the central tool and the basis
DFDs are the model of the proposed system. They clearly should show the
requirements on which the new system should be built. Later during design
activity this is taken as the basis for drawing the system’s structure charts.
destination.
System.
AUTHENTICATION DFD:
NO
Context Level :-
Physician
Employee
Pathology
Test
Patient Employee
Wards
Patients
Adding
Pathology
Test
Adding
Employee
Adding Wards
Treatment
Details
Operation
Details
Patient
Movement
View
Employees
View Bill
ADMIN:-
Add Physician
Specialization
Add Medical
Area
Add Medical
Area
Specialization
UI displaying set
Admin Login
Of Operations
Add
Treatments
General
Information Add
Pathology
Test
Add
Employees
Add
Employee
Types
Add
UI Interface InputStage OutputStage Data Store
Employee
Add
UI Interface InputStage OutputStage Data Store
Treatment
EMPLOYEE:-
Register Out
Patient
Register In
Patient
UI displaying set
Employee Login
Of Operations
Add
Treatment
Details
Add Patient
Operation
Register Out
UI Interface Input Stage OutoutStage Data Store
Patient
Register In
UI Interface Input Stage Output Stage Data Store
Patient
PATIENT:-
View Patients
UI displaying set
Patient Login
Of Operations
View Bill
Details
View Profile
E-R DIAGRAM
UML DIAGRAMS
In this model the data and functionality are arrived from inside the system.
This model view models the static structures.
In this the structural and behavioral as parts of the system are represented
as they are to be built.
In this the structural and behavioral aspects of the environment in which the
system is to be implemented are represented.
UML is specifically constructed through two different domains they are:
Actors are external entities that interact with the system. Examples of
actors include users like administrator, bank customer …etc., or
another system like central database.
CLASS COLLABORATIVE DIAGRAME
AddTreatm entDAO GetBedNum ber BedsDA O
I nPatientDAO
~flag: boolean Em ployeeDAO
~con: Connection = null A bstractDataAccessObject
~flag: boolean
~stmt: java. sql.CallableStatement = null
-mCon: Connection = null ~con: Connection = null
-mProps: Properties
+addI nPatient(inpatientform: com.dts. patient. form.I npatientForm): boolean ~stmt: java.sql. CallableStatement = null
+getProperties(): Properties +addEmployee(employeetype: EmployeeModelForm): boolean
OutPatientDAO +setProperties(aProps: Properties)
+getConnection(): Connection
~flag: boolean +getSequenceI D(tableName: String, pkid: String): int
~con: Connection = null
~stmt: java. sql.PreparedStatement = null
Employee
Administrator
Adding Of Physician
Administrator
Adding Employees
Adding Wards
View Profile
Adding In Patient
Employee
Treatment Details
Operation Details
Patient Movement
SEQUENCE DIAGRAMS
Logincheck:-
Administrator Login AdminHome Validate Database Logout
1 : LoginDetails()
2 : Validate()
3 : Check Details()
5 : Login_Check()
4 : Fail()
6 : Check Details()
7 : Forward If Sucess()
8 : Logout If fail()
6 : Check Details()
Logout
Database
5 : Login_Check()
3 : Check Details()
Validate
4 : Fail() 2 : Validate()
1 : LoginDetails()
Administrator Login
1 : LoginDetails()
2 : Validate()
3 : Check Details()
5 : Login_Check()
4 : Fail()
6 : Check Details()
7 : Forward If Sucess()
6 : Check Details()
Database
5 : Login_Check()
3 : Check Details()
Validate
4 : Fail()
Employee
2 : Validate()
1 : LoginDetails()
Login
ACTIVITY DIAGRAM
Activity Diagram For Administrator:-
Login
Validate
AdminHome
Add Physician Add Physician Specialization Adding treatment Add Pathology Test Add Employee Adding Wards
Logout
Validate
Employee Home
View Profile Adding in patient Adding out patient Treament Details operation details Patient Movement
Logout
COMPONENT DIAGRAM:
DEPLOYMENT DIAGRAM:
DATA DICTIONARY
ADDRESS MASTER:-
BEDSMASTER
DIAGNOSIS DETAILS
EMPLOYEEMASTER
INPATIENT MASTER
OUTPATIENT MASTER
PHONE MASTER
PHYSICIAN MASTER
ROOM MASTER
SPECIALIZATION MASTER
TREATMENT DETAILS
TREATMENT MASTER
WARDS MASTER
TECHNOLOGY DESCRIPTION
HTML
HTML is also often used to refer to content of the MIME type text/html or
even more broadly as a generic term for HTML whether in its XML-descended
form (such as XHTML 1.0 and later) or its form descended directly from
SGML
Attributes
Most elements take any of several common attributes: id, class, style and
title. Most also take language-related attributes: lang and dir.
Advantages
A HTML document is small and hence easy to send over the net.
It is small because it does not include formatted information.
HTML is platform independent.
HTML tags are not case-sensitive.
JavaScript
Even though JavaScript supports both client and server Web programming,
we prefer JavaScript at Client side programming since most of the browsers
supports it. JavaScript is almost as easy to learn as HTML, and JavaScript
statements can be included in HTML documents by enclosing the statements
between a pair of scripting tags
<SCRIPTS>.. </SCRIPT>.
JavaScript statements
</SCRIPT>
JavaScript Vs Java
JavaScript and Java are entirely different languages. A few of the most
glaring differences are:
There are many other differences but the important thing to remember is
that JavaScript and Java are separate languages. They are both useful for
different things; in fact they can be used together to combine their
advantages.
Advantages
Initially the language was called as “oak” but it was renamed as “Java” in
1995. The primary motivation of this language was the need for a platform-
independent (i.e., architecture neutral) language that could be used to create
software to be embedded in various consumer electronic devices.
Java has had a profound effect on the Internet. This is because; Java
expands the Universe of objects that can move about freely in
Cyberspace. In a network, two categories of objects are transmitted
between the Server and the Personal computer. They are: Passive
information and Dynamic active programs. The Dynamic, Self-
executing programs cause serious problems in the areas of Security
and probability. But, Java addresses those concerns and by doing so,
has opened the door to an exciting new form of program called the
Applet.
Every time you that you download a “normal” program, you are risking a
viral infection. Prior to Java, most users did not download executable
programs frequently, and those who did scan them for viruses prior to
execution. Most users still worried about the possibility of infecting their
systems with a virus. In addition, another type of malicious program exists
that must be guarded against. This type of program can gather private
information, such as credit card numbers, bank account balances, and
passwords. Java answers both these concerns by providing a “firewall”
between a network application and your computer.
When you use a Java-compatible Web browser, you can safely download Java
applets without fear of virus infection or malicious intent.
Portability
The key that allows the Java to solve the security and portability problems is
that the output of Java compiler is Byte code. Byte code is a highly optimized
set of instructions designed to be executed by the Java run-time system,
which is called the Java Virtual Machine (JVM). That is, in its standard form,
the JVM is an interpreter for byte code.
Translating a Java program into byte code helps makes it much easier to run
a program in a wide variety of environments. The reason is, once the run-
time package exists for a given system, any Java program can run on it.
Beyond the language, there is the Java virtual machine. The Java virtual
machine is an important element of the Java technology. The virtual machine
can be embedded within a web browser or an operating system. Once a piece
of Java code is loaded onto a machine, it is verified. As part of the loading
process, a class loader is invoked and does byte code verification makes sure
that the code that’s has been generated by the compiler will not corrupt the
machine that it’s loaded on. Byte code verification takes place at the end of
the compilation process to make sure that is all accurate and correct. So byte
code verification is integral to the compiling and executing of Java code.
Overall Description
Java .Class
Picture showing the development process of JAVA Program
Java Architecture
Compilation of code
When you compile the code, the Java compiler creates machine code
(called byte code) for a hypothetical machine called Java Virtual
Machine (JVM). The JVM is supposed to execute the byte code. The
JVM is created for overcoming the issue of portability. The code is
written and compiled for one machine and interpreted on all machines.
This machine is called Java Virtual Machine.
Code
Java
Java
……….. PC Compiler Interpreter
Java
……….. (PC)
Byte code Interpreter
Macintosh Java
(Spare)
……….. Compiler Interpreter
(Macintosh)
SPARC (Platform
Compiler Independ
………… ent)
During run-time the Java interpreter tricks the byte code file into
thinking that it is running on a Java Virtual Machine. In reality this
Simple
Object-Oriented
Java was not designed to be source-code compatible with any other
language. This allowed the Java team the freedom to design with a
blank slate. One outcome of this was a clean usable, pragmatic
approach to objects. The object model in Java is simple and easy to
extend, while simple types, such as integers, are kept as high-
performance non-objects.
Robust
What Is JDBC?
JDBC is a Java API for executing SQL statements. (As a point of interest,
JDBC is a trademarked name and is not an acronym; nevertheless, JDBC is
often thought of as standing for Java Database Connectivity. It consists of a
set of classes and interfaces written in the Java programming language.
JDBC provides a standard API for tool/database developers and makes it
possible to write database applications using a pure Java API.
So why not just use ODBC from Java? The answer is that you can use
ODBC from Java, but this is best done with the help of JDBC in the
form of the JDBC-ODBC Bridge, which we will cover shortly. The
question now becomes "Why do you need JDBC?" There are several
answers to this question:
1. ODBC is not appropriate for direct use from Java because it uses a C
interface. Calls from Java to native C code have a number of
drawbacks in the security, implementation, robustness, and automatic
portability of applications.
2. A literal translation of the ODBC C API into a Java API would not be
desirable. For example, Java has no pointers, and ODBC makes
copious use of them, including the notoriously error-prone generic
pointer "void *". You can think of JDBC as ODBC translated into an
object-oriented interface that is natural for Java programmers.
3. ODBC is hard to learn. It mixes simple and advanced features
together, and it has complex options even for simple queries. JDBC, on
the other hand, was designed to keep simple things simple while
allowing more advanced capabilities where required.
4. A Java API like JDBC is needed in order to enable a "pure Java"
solution. When ODBC is used, the ODBC driver manager and drivers
must be manually installed on every client machine. When the JDBC
driver is written completely in Java, however, JDBC code is
automatically installable, portable, and secure on all Java platforms
from network computers to mainframes.
Two-tier and Three-tier Models
The JDBC API supports both two-tier and three-tier models for
database access.
In the two-tier model, a Java applet or application talks directly to the database. This
requires a JDBC driver that can communicate with the particular database management
system being accessed. A user's SQL statements are delivered to the database, and the
results of those statements are sent back to the user. The database may be located on
another machine to which the user is connected via a network. This is referred to as a
client/server configuration, with the user's machine as the client, and the machine housing
the database as the server. The network can be an Intranet, which, for example, connects
employees within a corporation, or it can be the Internet.
JAVA
Client machine
Application
JDBC
DBMS-proprietary protocol
Database
server
DBMS
Java applet or
Client machine (GUI)
Html browser
JDBC Logic)
DBMS-proprietary protocol
Database server
In the three-tier model, commands are sent to a "middle tier" of services,
which then send SQL statements to the database. The database processes
DBMS
the SQL statements and sends the results back to the middle tier, which then
sends them to the user. MIS directors find the three-tier model very
attractive because the middle tier makes it possible to maintain control over
access and the kinds of updates that can be made to corporate data. Another
advantage is that when there is a middle tier, the user can employ an easy-
to-use higher-level API which is translated by the middle tier into the
appropriate low-level calls. Finally, in many cases the three-tier architecture
can provide performance advantages.
Until now the middle tier has typically been written in languages such
as C or C++, which offer fast performance. However, with the
introduction of optimizing compilers that translate Java byte code into
efficient machine-specific code, it is becoming practical to implement
the middle tier in Java. This is a big plus, making it possible to take
advantage of Java's robustness, multithreading, and security features.
JDBC is important to allow database access from a Java middle tier.
JDBC Driver Types
The JDBC drivers that we are aware of at this time fit into one of
four categories:
JDBC-ODBC Bridge
If possible, use a Pure Java JDBC driver instead of the Bridge and an
ODBC driver. This completely eliminates the client configuration
required by ODBC. It also eliminates the potential that the Java VM
could be corrupted by an error in the native code brought in by the
Bridge (that is, the Bridge native library, the ODBC driver manager
library, the ODBC driver library, and the database client library).
Originally found only in large companies with the computer hardware needed
to support large data sets, DBMSs have more recently emerged as a fairly
standard part of any company back office.
Description
The DBMS accepts requests for data from the application program and
instructs the operating system to transfer the appropriate data.
Organizations may use one kind of DBMS for daily transaction processing and
then move the detail onto another computer that uses another DBMS better
suited for random inquiries and analysis. Overall systems design decisions
are performed by data administrators and systems analysts. Detailed
database design is performed by database administrators.
Database servers are specially designed computers that hold the actual
databases and run only the DBMS and related software. Database servers are
usually multiprocessor computers, with RAID disk arrays used for stable
storage. Connected to one or more servers via a high-speed channel,
hardware database accelerators are also used in large volume transaction
processing environments.
DBMSs are found at the heart of most database applications. Sometimes
DBMSs are built around a private multitasking kernel with built-in networking
support although nowadays these functions are left to the operating system.
SQL
Data definition: Defining tables and structures in the database (DDL used
to create, alter and drop schema objects such as tables and indexes).
List of SQL statements that can be issued against an Oracle database schema
are:
Introduction
The Java web server is JavaSoft's own web Server. The Java web
server is just a part of a larger framework, intended to provide you not
just with a web server, but also with tools. To build customized
network servers for any Internet or Intranet client/server system.
Servlets are to a web server, how applets are to the browser.
About Servlets
Servlets are objects that conform to a specific interface that can be plugged
into a Java-based server. Servlets are to the server-side what applets are to
the client-side - object byte codes that can be dynamically loaded off the net.
They differ from applets in that they are faceless objects (without graphics or
a GUI component). They serve as platform independent, dynamically
loadable, pluggable helper byte code objects on the server side that can be
used to dynamically extend server-side functionality.
Attractiveness of Servlets
There are many features of Servlets that make them easy and attractive to
use. These include:
• It’s extensible - you can inherit all your functionality from the base
classes made available to you.
• It’s simple, small, and easy to use.
Features of Servlets:
• Servlets are persistent. Servlet are loaded only by the web server
and can maintain services between requests.
• Servlets are fast. Since Servlets only need to be loaded once, they
offer much better performance over their CGI counterparts.
• Servlets are platform independent.
• Servlets are extensible. Java is a robust, object-oriented
programming language, which easily can be extended to suit your
needs
• Servlets are secure.
• Servlets can be used with a variety of clients.
Loading Servlets:
From a remote location, for this a code base like http: // nine.eng / classes /
foo / is required in addition to the Servlets class name. Refer to the admin
GUI docs on Servlet section to see how to set this up.
Invoking Servlets
Features of JSP
Portability:
Java Server Pages files can be run on any web server or web-
enabled application server that provides support for them. Dubbed
the JSP engine, this support involves recognition, translation, and
management of the Java Server Page lifecycle and its interaction
components.
Components
It was mentioned earlier that the Java Server Pages architecture
can include reusable Java components. The architecture also allows
for the embedding of a scripting language directly into the Java
Server Pages file. The components current supported include Java
Beans, and Servlets.
Processing
Access Models:
In both of the above cases, the page could also contain any valid
Java code. Java Server Pages architecture encourages separation of
content from presentation.
Steps in the execution of a JSP Application:
1. The client sends a request to the web server for a JSP file by
giving the name of the JSP file within the form tag of a HTML
page.
jsp and then it converts those tags into a Servlet program and it
to the client.
About Stuts:
Applications built using the Struts framework are at their core, web
applications. A web application is a collection of individual components
that once bound together, form a complete application that can be
installed and executed by a web container. The components are tied
together due to the fact that they reside in the same web context and
in many cases, may refer to one another, directly or indirectly.
Obviously, not all web applications are created equal. They will not
have the same functional and non-functional requirements across
organizations, departments, or even the same vertical markets.
Therefore, not all web applications will contain the same types of
resources. In general however, web applications can consist of one or
more of the following types of components:
Servlets
JSP Pages
HTML Documents
Text Documents
The early JSP specifications presented two approaches for building web
applications using JSP technology. These two approaches were
described in the specification as JSP Model 1 and Model 2
architectures. Although the terms are no longer used in the JSP
specification, their usage throughout the web tier development
community is still widely used and referenced.
The two JSP architectures differed in several key areas. The major
difference was how and by which component the processing of a
request was handled. With the Model 1architecture, the JSP page
handles all of the processing of the request and is also responsible for
displaying the output to the client.
As you can see, the main difference between the two approaches is
that the Model 2 architecture introduces a controller servlet that
provides a single point of entry and also encourages more reuse and
extensibility than Model 1. With the Model 2 architecture, there is also
a clear separation of the business logic, presentation output, and
request processing. This separation is often referred to as a Model-
View-Controller (MVC) pattern. While the Model 2 architecture might
seem overly complicated, it can actually simplify an application
greatly. Web applications built using the Model 2 approach are
generally easier to maintain and can be more extensible than
comparable applications built around the Model 1 architecture.
All of this doesn’t mean that applications built using the Model 1
approach are incorrectly designed. The Model 1 architecture might be
the best decision for smaller applications that have simple page
navigation, no need for centralized features, and are fairly static.
However, for more larger enterprise-size web applications, it would be
more advantageous to utilize the Model 2 approach.
The views within the web tier MVC pattern typically consist of HTML
and JSP pages. HTML pages are used to serve static content, while JSP
pages can be used to serve both static and dynamic content. Most
dynamic content is generated in the web tier. However, Web
applications are considered stateless because the browser doesn’t
typically maintain an open socket to the web server. However, a web
application may still maintain session data for a user or even store
data within the browser on behalf of the user. some applications may
require the need for client-side JavaScript. This does not interface or
infringe upon the MVC concept.
The controller portion of the web tier MVC design is generally a Java
servlet. The controller in a web tier application performs the following
duties:
The Front Controller pattern, which is part of the J2EE Design Patterns,
describes how a web tier controller should be implemented. Since all
client requests and responses go through the controller, there is a
centralized point of control for the web application. This aides in
maintenance and when adding new functionality. Code that would
normally need to be put in every JSP page can be put in the controller
servlet, since it processes all requests. The controller also helps to
decouple the presentation components (views) from the business
operations, which also aids development.
What is a Framework?
You also learned that, with the JSP Model 2 architecture, on which
Struts was fashioned the controller was implemented by a Java
servlet. This servlet becomes the centralized point of control for the
web application. The controller servlet maps user actions into business
operations and then helps to select the view to return to the client
based on the request and other state information.
The Struts Action class contains several methods, but the most
important is the execute() method. Here is the method signature:
At this point, you might be asking yourself, “How does the controller
know which Action instance to invoke when it receives a request?” The
answer is by inspecting the request information and utilizing a set of
action mappings. Action mappings are part of the Struts configuration
information that is configured in a special XML file. This configuration
information is loaded into memory at startup and made available to
the framework at runtime. Each <action> element is represented in
memory by an instance of the org.apache.struts.action.ActionMapping
class. The ActionMapping object contains a path attribute that is
matched against a portion of the URI of the incoming request.
Whenever the controller receives a request where the path in the URI
contains the string “/login”, the execute() method of the LoginAction
instance will be invoked. The Struts framework also uses the mappings
to identify the resource to forward the user to once the action has
completed.
We’ve talked about how the controller receives the request and how
the action mappings and request information are used to determine
the correct action instance to invoke and pass the request to. What
hasn’t been discussed is how or what determines the view to return
back to the client. If you looked closely at the execute() method
signature in the Action class from the previous section, you might have
noticed that the return type for the method is an
org.apache.struts.action.ActionForward class. The ActionForward class
represents a destination to which the controller may send control once
an Action has completed. Instead of specifying an actual JSP page in
the code, you can declaratively associate an action forward mapping
with the JSP and then use that ActionForwardthroughout your
application. The action forwards are specified in the configuration file,
similar to action mappings.
The logout action declares a <forward> element that is named
“Success”, which forwards to a resource of “/login.jsp”. Notice in this
case, a redirect attribute is set to “true”. Instead of performing a
forward using a RequestDispatcher, the request that invokes the
logout action mapping will be redirected instead.
<global-forwards>
</global-forwards>
The forwards defined in the global section are more general and don’t
apply to a specific action. Notice that every forward must have a name
and path, but the redirect flag is optional. If you don’t specify a
redirect attribute, its default value is false and thus performs a
forward. The path attribute in an ActionForward can also specify
another Struts Action.
The last of the MVC components to discuss are the Struts View
components. Arguably, it’s the easiest to understand. The view
components that are typically employed in a Struts application are:
JavaServer Pages
Custom Tags
HTML
Value Objects
1. Check the mapping for the action and see if a form bean has been
configured for it.
2. If so, use the name attribute to lookup the form bean configuration
information.
3. Depending on the scope configured for the form bean for the action,
check to see if there’s already an instance of the form bean at the
appropriate scope.
JavaServer Pages make up the majority of what has to be built for the
Struts view components. Combined with custom tag libraries and
HTML, it becomes easy to provide a set of views for an application.
Although JavaServer Pages make up the majority of what
organizations and developers are using to display the dynamic content,
it’s not the only technology. There are other forms of presentation
technologies that can be combined with the Struts framework. One
very popular one is the XML/XSLT combination. This alternate model is
being referred to as Model 2X, which is a combination of the controller
servlet from the Struts framework and XSLT and beans serialized from
the value objects to render the views. Many developers feel that JSP
has the following problems:
JSP syntax is not currently XML compliant, which may cause the
XML or HTML that gets generated, not to be “well formed”.
A recompile of the JSP page is necessary for each change made to the
page.
The Struts framework provides five core tag libraries that can be used
by your applications. Each one has a different purpose and can be
used individually or along side the others. You may also create your
own custom tags and can even extend the Struts tags if you need
them to perform extra functionality. The custom tag libraries that are
included with the framework are:
To use the libraries in your application, you need to first register them
with the web application. To do this, you should add the following lines
to the deployment descriptor for each web application that you wish to
use Struts for.
<web-app>
<taglib>
<taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-template.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-template.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-nested.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-nested.tld</taglib-location>
</taglib>
</web-app>
The next step is to create your JSP pages and include the following
lines.
Once this is done and the Struts JAR file is in the web application’s
CLASSPATH, you are then able to use the custom tags in your JSP
pages.
The standard Java support for Internationalization has grown with the
past several releases and the Struts framework could probably use
what’s included with 1.2 and newer, but since Struts was created
before 1.2, they had to build in their own support for several key
pieces. With a Struts application, you must provide a Java message
bundle for each language that
you wish to support A message resource bundle is used for reasons
other than just for localization. It can also save time during application
maintenance. For example, if you use the same text messages or
labels throughout various parts of your web site or application, when
one or more of these values need to change, you only need to make
the change in a single location. Even if you don’t have requirements
for Internationalization, you should still utilize resource bundles.
With Struts 1.1, you now have the ability to define multiple
MessageResources for an application. This allows you isolate certain
types of resources, into separate bundles. For example, you might
want to store the image resources for an application into one bundle
and the rest of the resources into another. How you organize your
application’s resources is up to you, but you now have the flexibility to
separate them based on some criteria. Some applications choose to
separate along components lines
The Struts framework uses two separate, but somewhat related types
of configuration files, which must be properly configured before an
application will function properly. Due to the popularity and flexibility
of the self-describing nature of XML, both of these configuration files
are based on XML.
The web application deployment descriptor web.xml is described fully
in the Java Servlet specification. This configuration file is necessary for
all web applications, not just those built with the Struts framework.
There is however, Struts specific deployment information that must be
configured within it when building web applications using Struts.
<struts-config>
<data-sources>
<form-beans>
<global-exceptions>
<global-forwards>
<action-mappings>
<controller>
<message-resources>
<plug-in>
</struts-config>
Note that we have to follow the above order strictly, otherwise it will
throw exceptions.
What are ActionForms?
If you need to keep the form data around longer than the request,
you can configure an ActionForm to have session scope. This might be
necessary if your application captures data across multiple pages,
similar to a wizard dialog. An ActionForm that has been configured
with session scope will remain in the session until it’s removed,
replaced with another object, or until the session times out. The
framework doesn’t have a built-in facility for cleaning up session
scoped ActionForm objects automatically. Like any other object placed
into the HttpSession, it’s up to the application to routinely perform
clean up on the resources stored there. This is slightly different from
objects placed into the request, because once the request is finished,
they can be reclaimed by the garbage collector since they can no
longer be referenced. Unless you need to specifically hold the form
data across multiple requests, you should use request scope for your
ActionForm objects.
Creating an ActionForm
<action
validate="true" input="/security/signin.jsp">
</action>
The reset() method has been a bane for much of the Struts user
community at one time or another. Exactly when the reset() method is
called and what should be done within it is almost always
misinterpreted. This doesn’t mean that one implementation is more
correct than another, but there are misconceptions that many new
Struts developers pick up and then have a hard time shaking regarding
the reset().
It’s called before the ActionForm has been populated from the
request. The method was added to the ActionForm class originally to
help facilitate resetting boolean properties back to their defaults. To
understand why they need to be reset, it’s helpful to know how the
browser and the HTML form submit operation processes checkboxes.
When an HTML form contains checkboxes, only the values for the
checkboxes that are checked are sent in the request. Those that are
not checked are not included as a request
Once you have created a class that extends ActionForm, you need
to configure the class in the Struts configuration file. The first step is
to add a new form-bean element to the form-beans section of the file:
<form-beans>
</form-beans>
The value for the type field must be a fully qualified Java class name
that is a descendant of ActionForm. Once you have defined your form-
bean, you can now use it in one or more action elements. It’s very
common to share one ActionForm across several actions.
All request parameters that are sent by the browser are Strings. This
is true regardless of the type that the value will eventually map to in
Java. For example, dates, times, Booleans, and other values are all
strings when they are pulled out of the request. They will also be
converted into strings when they are written back out to the HTML
page.Therefore, it makes sense that all of the ActionForm properties
where the input may be invalid, should be of type String. The reason
for this is to support displaying the data back out in its original form to
the user, when there is an error. For example, if a user types in “12Z”
for a property expecting to be an Integer, there’s no way to store
“12Z” into an int or Integer property. However, you can store it into a
String until it can be validated. This same value, which is stored in a
String, can be used to render the input field with the value, so the user
can see their mistake. This is functionality that even the most
inexperienced users have come to expect and look for.
Using ActionErrors
Earlier in the chapter, you saw that the validate() method returned an
ActionErrors object. The ActionErrors class encapsulates one or more
errors that have been discovered by the application. Each problem
discovered is represented by an instance of
org.apache.struts.action.ActionError. An ActionErrors object has
request scope. Once an instance is created and populated by the
validate() method, it is stored into the request. Later, the JSP page
can retrieve the object from the request and use the ActionError
objects contained within it to display errors messages to the user.
errors.add("password",new
ActionError("security.error.password.required"));
return errors;
}
The validate() method in this fragment checks to make sure that the
email and password fields have been set with values other than an
empty string. If not, ActionError objects are added to the ActionErrors
instance.
The key argument is a String value that corresponds to a key from one
of the application’s resource bundles. The custom tag ErrorsTag uses
this value to lookup the message to display to the user. The remaining
arguments are used as parametric replacement values for the
message. For example, if you had a bundle message defined like this:
errors.add(ActionErrors.GLOBAL_ERROR,
new ActionError("security.error.password.required"));
The first and foremost problem with using ActionForms is the sheer
number of classes that it can add to a project. Even if you share
ActionForm definitions across many pages, the additional classes make
it more difficult to manage a project and provide maintenance. This is
why some developers might create a single ActionForm and implement
the properties for all of the HTML forms within these. The problem with
this of course, is that combining the fields into this one class makes it
a point of contention on
a project that has more than just a few developers. Another major
liability is the requirement to define the properties in the ActionForm
that need to be captured from the HTML form. If a property is added
or removed from the
<form-beans>
<form-bean name="loginForm" dynamic="true"
type="org.apache.struts.action.DynaActionForm">
<!-- You can also set the initial value of a property -->
<form-property initial=”false”
</form-bean>
<form-beans>
The form-beam element also allows you to specify the initial value for
each property. The framework will set the property to that value when
the application is started. The initial value is also used when the
reset() method is called to reset the values back to their original state.
If you don’t include the initial attribute, then properties will be
assigned default values based on the Java programming language;
numbers to zero (0) and properties of type Object will be assigned a
null value by the framework.
The following are the built-in actions given under the struts
framework:
ForwardAction
IncludeAction
SwitchAction
DispatchAction
ForwardAction:
Syntax:
<action path=“/mypath”
type=“org.apache.struts.actions.ForwardAction”
parameter=“/MyPage.jsp”/>
(OR)
IncludeAction:
Syntax:
<action path=“/mypath”
type=“org.apache.struts.actions.IncludeAction”
parameter=“/MyPage.jsp”/>
(OR)
SwitchAction:
The prefix parameter takes module name beginning with “/”, i.e, to
which module the request should be switched.
Configuration in struts-config.xml:
<action path=“/changeModule”
type=“org.apache.struts.actions.SwitchAction”prefix=“/admin”
page=“/home.jsp”/>
DispatchAction:
Subclass the Action class with DispatchAction class and provides a set
of methods that will be called by the execute() method of
DispatchAction.
Note that this class should not override execute() method like other
actions.
</action>
Eclipse IDE:
Eclipse is an open-source software framework written primarily in
Java. In its default form it is an Integrated Development Environment
(IDE) for Java developers, consisting of the Java Development Tools
(JDT) and the Eclipse Compiler for Java (ECJ). Users can extend its
capabilities by installing plug-ins written for the Eclipse software
framework, such as development toolkits for other programming
languages, and can write and contribute their own plug-in modules.
Language packs are available for over a dozen languages.
Architecture:
The basis for Eclipse is the Rich Client Platform (RCP). The following
components constitute the rich client platform:
The key to the seamless integration of tools with Eclipse is the plug-in.
With the exception of a small run-time kernel, everything in Eclipse is
a plug-in. This means that a plug-in you develop integrates with
Eclipse in exactly the same way as other plug-ins; in this respect, all
features are created equal.
The Eclipse SDK includes the Eclipse Java Development Tools, offering
an IDE with a built-in incremental Java compiler and a full model of
the Java source files. This allows for advanced refactoring techniques
and code analysis. The IDE also makes use of a workspace, in this
case a set of metadata over a flat file space allowing external file
modifications as long as the corresponding workspace "resource" is
refreshed afterwards. The Visual Editor project allows interfaces to be
created interactively, hence allowing Eclipse to be used as a RAD tool.
1. Core projects:
Rich Client Platform (Platform) is the core framework that all other
Eclipse projects are built on.
Java Development Tools (JDT) provides support for core Java SE. This
includes a standalone fast incremental compiler.
2. Tools projects:
3. Web projects:
J2EE Standard Tools (JST) extends the core JDT to include support for
Java EE projects. This includes EJBs, JSPs and Servlets.
4. Modeling projects:
Eclipse Modeling Framework (EMF) a modeling framework and code
generation facility for building tools and other applications based on a
structured data model, from a model specification described in XMI.
5. Other projects:
WebServer/Application Server:
Common features:
Java EE Servers:
Following the success of the Java platform, the term application server
sometimes refers to a Java Platform--Enterprise Edition (J2EE) or Java
EE 5 application server. Among the better known Java Enterprise
Edition application servers are WebLogic Server (BEA), JBoss (Red
Hat), WebSphere (IBM), JRun (Adobe), Apache Geronimo (Apache
Foundation, based on IBM WebSphere), Oracle OC4J (Oracle
Corporation), Sun Java System Application Server (Sun Microsystems)
and Glassfish Application Server (based on Sun Java System
Application Server).
Java application server was the first open source application server to
have achieved official compliance with the Java Enterprise
Specification. BEA delivered the first Java EE 5 certified application
server followed by Sun Microsystems' reference implementation
Glassfish.
The Web modules are servlets and Java Server Pages, and business
logic is built into Enterprise JavaBeans (EJB-3 and later). The
Hibernate project offers an EJB-3 container implementation for the
JBoss Application server. Tomcat from Apache and JOnAS from
ObjectWeb are typical of containers into which these modules can be
put.
A Java Server Page (JSP) is a servlet from Java that executes in a Web
container—the Java equivalent of CGI scripts. JSPs are a way to create
HTML pages by embedding references to the server logic within the
page. HTML coders and Java programmers can work side by side by
referencing each other's code from within their own. JavaBeans are the
independent class components of the Java architecture from Sun
Microsystems.
JBOSS
JBoss Application Server (or JBoss AS) is a free software / open source
Java EE-based application server. Because it is Java-based, JBoss AS is
cross-platform, usable on any operating system that Java supports.
Environment
Load balancing
<%@page import="com.dts.project.model.AdvanceModel"%>
<%@page import="com.dts.dae.model.Profile"%>
<%@page import="com.dts.project.model.AllowanceModel"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script>
<script>
alert('Called');
alert(myName);
window.location.href="http://localhost:8081/NewPayRoll1/CheckAdvanceActi
on?AdvanceName="+myName+"&AdvanceId="+myValue;
function inDate(){
document.register.aDate.value=date.getDate()+"-"+(date.getMonth()
+1)+"-"+date.getYear();
function check(){
var min=document.register.aMinValue.value;
var max=document.register.aMaxValue.value;
if(min<max){}
else
document.getElementById("max").focus();
}
</script>
<STYLE type=text/css>
input {
width: 125px;
font-family: Verdana;
font-size: 8pt;
</style>
<style type="text/css">
<!--
body {
background-color: #FFFFFF;
}
-->
</style>
</head>
<body>
<tr>
<tr>
</tr>
</table></td>
</tr>
<tr bgcolor="#ffffff">
</tr>
<tr bgcolor="#a4c2c2">
<jsp:include page="GeneralOptions.html"/>
</td>
<td width="125" bgcolor="#16B3AA"> </td>
</tr>
<tr bgcolor="#ffffff">
</tr>
<tr bgcolor="#ffffff">
<tr>
<td width="15"> </td>
<td width="15"> </td>
</tr>
</table> </td>
{%>
<strong><font color=red><
%=request.getParameter("status")%></font></strong>
<%}%></center>
<tr>
</tr>
<tr>
</tr>
<tr>
</td>
</tr>
<tr>
</tr>
<tr>
<td class="label" align="right" width="40%">Username:</td>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
</table>
</form>
<script>
</script>
<td width="108"> </td>
<td width="61"> </td>
</tr>
<tr bgcolor="#ffffff">
<td colspan="6">`</td>
</tr>
<tr>
</tr>
</body>
</html>
TESTING
Testing Concepts
• Testing
• Testing Methodologies
• Levels of Testing
Unit Testing.
Module Testing.
Integration Testing.
System Testing.
User Acceptance Testing.
• Types Of Testing
Smoke Testing.
Sanitary Testing.
Regression Testing.
Re-Testing.
Static Testing.
Dynamic Testing.
Alpha-Testing.
Beta-Testing.
Monkey Testing.
Compatibility Testing.
Installation Testing.
Adhoc Testing.
Ext….
• STLC
Test Planning.
Test Development.
Test Execution.
Result Analysis.
Bug-Tracing.
Reporting.
Levels of Testing:
Test Planning:
1.Test Plan is defined as a strategic document which
describes the procedure how to perform various testing on the
total application in the most efficient way.
3. Objective of testing,
Used….
Test Development:
Result Analysis:
> Smoke Testing: is the process of initial testing in which tester looks for
the availability of all the functionality of the application in order to perform
detailed testing on them. (Main check is for available forms)
Test Scenario:
• When the office personals use this screen for the payment, tariff and
company registration and web advertisements on basis of
requirements and quit the form.
Test Procedure:
• The procedure for testing this screen is planned in such a way that the
data entry, status calculation functionality, saving and quitting
operations are tested in terms of GUI testing, Positive testing,
Negative testing using the corresponding GUI test cases, Positive test
cases, Negative test cases respectively
Test Cases:
password
1
2
2
SCREENS
REPORTS
FUTURE ENHANCEMENTS
Future Enhancements:
It is not possible to develop a system that makes all the requirements of
the user. User requirements keep changing as the system is being used.
Some of the future enhancements that can be done to this system are:
be easily adaptable.
emerging technologies.
This application software has been computed successfully and was also
desired operations.
The software is developed using Java as front end and Oracle as back end in
Windows environment. The goals that are achieved by the software are:
User friendly.
SPD
O’Reilly – SPD