Applying JSP and Servlets in Introducing Secure Web-Based
Applying JSP and Servlets in Introducing Secure Web-Based
Abstract:
At the present time websites produce dynamic responses to the user requests. So there is a need for
dynamic web Scripting languages. A web page is a server-side dynamic page whose structure is controlled
by server-side scripts. The Scripting Language refers to dynamic high level general purpose language.
Three most popular web scripting languages are: PHP, JSP and ASP.NET languages in the world. The
major requirements for enterprise applications are Performance, Scalability, manageability, code
portability, mode of source, Cloud Feasibility, database, security are rapidly increasing. Now the issue in
this competitive environment is choosing the best scripting language .the paper basically depicts the use
of java server pages as well as servlets in building a web application.variety of topics will be covered in
this paper including: Introduction to jsp and servlets , Life cycle and architecture of servlet and jsp
,Difference between jsp and servlets
KEYWORDS: Generation, Web Content, platform, External Hosting, CGI and Web Application
1. Introduction
The World Wide Web is from the Client-Server application. Web browsers make requests of Web servers
to return a file that is displayed on the browser. In this way the Web server acts as a file server for the
browser client.
Web application allows programs to be widely available without the need to physically transfer the
program’s file, and allows programs to be accessed remotely without dedicated connections. This area is
currently one of the fastest growing aspects of information technology. The web applications are moving
very fast toward the world of trading and business.
Like many areas of new technology there are many methods and products available to produce this form
of information processing. However all can be divided into types:
1. Server Side Techniques
This part of the web technology is dedicated to the server side and runs on it.
2. Client Side Techniques
The client side technology is for the client side and it runs on it.
In this approach the browser requests the program from the web-server that then call the program itself
(either from its own memory or from a remote server) and then returns the result to the browser. This is
the traditional client-server relationship, the client makes the request and all the processing is done by the
server.
This approach has many advantages, mainly because it is simple and well understood. Firstly there are no
compatibility problems; the application is always run on the same machine and does not rely on specific
browser parameters or other software running on the client's machine. This is important as there are many
types of browser available and there is little standardization beyond the most basic HTML concepts. Even
the two most widely used browsers, Netscape Navigator and Microsoft Explorer have many differences
and each comes in several different versions for different machine technologies which have subtle
differences between them [1].
Secondly running the application on the server often makes good sense because that is where the data
required for the program exists; for example one of the most common form of application is data-base
access and it is more practical for the application to run on the same machine as the data-base, thus
simplifying the whole process.
There is, however, a drawback to server-side applications. Since all processing occurs on the server it
could become over-loaded; if too many requests are made by different clients the server might find it
difficult or impossible to keep up with the processing required.
This is an important point because many clients may be browsing the same web-site at one time.
A JSP page contains standard markup language elements, such as HTML tags. However a JSP page
contains special JSP elements that allow the server to insert dynamic content in the page. JSP elements
can be used for different purposes, such as manipulating data stored in a database.
JSP defines a number of standard elements useful for web application; such as accessing JavaBeans
components, passing control between pages, and sharing information between requests, pages and
users[2].
JSP lets the developer to develop web application by embedding specialized code into HTML pages. Java
is the default scripting language of JSP, but the JSP allows for other languages to be used, such as
JavaScript, Perl, and VBScript. The following is a simple JSP page:
<html>
<body>
<% java.util.Date clock = new java.utl.Date();%>
<% if (Clock.getHours() < 12 ){ %>
<h1> Good morning</h1>
<%else if (Clock.getHours() < 18) { %>
<h1> Good day</h1>
<% }else{%>
<h1> Good evening</h1>
<% } %>
</body>
</html>
C. JAVA SERVLETS
Java Servlets are a way of using Java for server side processing. It provides a component- based, platform-
independent method for building web-based applications.
Server side scripting and programming based on Java classes includes Java Servlet and Java Server Pages.
Why Java? Some Web servers, such as Sun's Java Web Server (JWS), W3C's Jigsaw and Gefion
Software's LiteWebServer (LWS) are implemented in Java and have a built-in servlet engine.
Other Web servers, such as Netscape's Enterprise Server, Microsoft's Internet Information Server (IIS)
and the Apache Group's Apache, require a servlet engine add-on module, but every most popular server
To develop this web application. We need some tools and a work environment. The first is the Java2 SDK
(Java 2 Standard Edition). which can allow us to compile Java code. The second is a servlet container In
this project, Tomcat was used for Serviet development and deployment. The Apache Project's Tomcat is
the reference implementation of Java Servlet 2.2 and JSP 1.1 technologies. Tomcat is available Iree from
jakarta.apache.org. It is also an open source under the Apache Software Licence version 1.1.
On the other hand, a database could be seen as dynamic, it can be changed by its functions: create, insert
or delete data. The Web - database is an appropriate approach to combine both of HTML document and
databases it forms the capability to apply dynamic applications on the Www As that. "the Web could be
seen as a platform for providing users with an interface to one or more databases Data intensive business
applications consist of four components: the database, the transaction logic, the application logic and the
user interface [4].
In the past, enterprises would put all these components in the mainframe environment.
currently, the business environments are increasingly decentralisation, a enterprise can takes. operation in
different places the client - server system was developed for this trend. There are two types of client -
server system architecture:
The traditional two - tier architecture and three - tier architecture, shown in Figure (3).
Figure (3) The traditional Two Tier architecture and three Tier architecture
using other Tomcat vesion, the sample JSP runs slower than the last version! Execution times doubled for
both "10000" and "100000" tests. also Tomcat 9 server needs some performance tuning.
References:
1. Powell, Web Design: The complete reference, 2000, McGraw-Hill,USA
2. Hans Bergsten, JAVAServer Pages,2001, O’Reilly & Associates, USA Jason Whittaker, Producing
for the web,2000, Routledge, USA
3. http://www.javatpoint.com/life-cycleof-a-servlet
4. Barry Eaglestone, Relational Database, 1991, Stanley Thornes Ltd,UK