Anda di halaman 1dari 22

Project Report

On
Java in Web Development
Submitted to Computer Science Department
Govt Engg College , Jhalawar

Contents :
1.
2.
3.
4.
5.
6.
7.
8.

Introduction
Objectives
Overview of system
Tools for developing the room rental system
Technologies to be used
Tables used in the database
Getting Started
Conclusion

1. Introduction
In the age of today , the cities are in the competition of being more and more dense day per day
and according the census of India the cities have the biggest part of Indian population ,then it becomes too
tough to search a Room or Home in the big cities according to our budget ,our desired location ,needed
functionalities and the environment around it .
Then we need a System that reduces our complexities for finding out a optimized solution for us.
Room Rental System is developed to reduce the complexities to search a room .Room Rental System
provides the facility to anyone to search inside a particular selected area after login.
For the landlord:

Initially landlord registers for the system using signup and then provides the complete information to the
admin of system like name , location , photo , contact number , email id and some of the pictures of the room
or the home , he wants to give on the rent .

For the person who is searching for:


Initially he also registers for the site and then can search the desired room or home according to the
particular area or according to the cost range in a particular area.
Then he books the room and admin sends the mail to both, the landlord and to the needed person
about booking certification and then they can contact directly.

2. Objectives
The main objective of this web project is just to reduce the complexity of searching the room or home
in real life environment.
As in real life environment to there is too tough because at first we need to search the multiple
places by going there over the different-different times and then to analyse all the places then optimize
situations and then need to decide and book the room.
But using this website they will be able to check all multiple options at different places or different
colonies of a city at home easily, and even can book the selected one and a meeting is confirmed after
booking. Thus finally the have to go once to meet the selected landlord.

3. Overview of the Website

In the website we basically list and deeply work on the following areas as :
1. Admin Section
2. Search by Place
3. Search by Cost

Fig. Basic building block of the Website

4. Tools for developing the Room Rental System

To Implement the web project using java Server Pages (JSP) technology to develop a Room Rental System ,
we need some most important tools as listed below :1.
2.
3.
4.
5.
6.

Apache-Tomcat server (We used Apache-Tomcat-8.0.14 server)..


JDK (Java Development Kit)
MySQL for Jdbc connectivity
SQLyog Enterprise MySQL-GUI (To provide interface between MySQL and JSP)
Notepad++
Client side Browser

5. Technologies to be used
In developing the web project of Room Rental System , we used the java technology JSP (java server
pages). We developed complete source in java server pages .here we are providing an example of the code
in jsp to connect the jsp program to the mysql database .

Servlet Application Architecture:The application architecture states that when a client interact with server side programing like Servlet or JSP, the different technologies provided
by java are used to interact with other programs.
1. JDBC: Java Database Connectivity, this technology is used when Servlet/JSP wants to communicate with database. The database can be
developed in MSAccess, Oracle, MySql and many more. Java provides you facility to interact with all the database tools which are available
in the market.
2. RMI: Remote method Invocation, to develop distributed application in java RMI is used.
3. SOAP: Simple Object Access Protocol, to implement web services in java application.

Advantages of using Servlet technology:1. Access to entire family of java APIs:


The java platform provides a servlet developer with a robust API, object-oriented programming, platform neutrality, strict type, garbage
collection and all the security feature of the JVM.

2. Life cycle management:


A servlet container provides life cycle management, a single process to share and manage application wide resources, and interaction with a
web server.

3. Widespread Acceptance:
Acceptance of servlet at a very large scale because of all there is to be gained from using servlets, they are being widely accepted. The vendors are
providing servlet support in two main forms. The first form is servers, and second is by using third party
Add-one.
4. Efficient:
A servlet initialization code is executed only the first time web server loads it. After the server is loaded, handling new request is only matter
of calling a service method.
5. Platform and server independent :
Servlets are developed using java therefore they are portable and platform independent. Code compiled on one platform can move to another
platform without any change.
6. Persistent:
Servlet can maintain state between requests. When a servlet is loaded, it stays resident in memory while serving incoming requests.
7. Robust:

As servlet has the access to entire JDK, they are very powerful and have robust solutions. It also includes exception handling, garbage
collection, class libraries that provide network support, database access, distributed object component and many other tasks.
8. Extensible:
Servlet possess extensible properties that mean they can be extended and polymorphed into new objects that better suit your needs.
9. Secure:
Servlet run on the server side inheriting the security provided by the web server. Servlets can also take advantage of the security manager.

Servlet Life Cycle:It describe how a servlet is loaded, instantiated, initialized, service request, and destroyed and finally garbage collected.
The life cycle of a servlet is determined by three of its methods:
1. init() method
2. service() method
3. destroy() method
There are three methods which are very important in servlet life cycle i.e. inti(), service(0, and destroy(). Server invokes init() method
when servlet is first loaded in to the web server memory. Servlet reads HTTP data provided in HTTP request in the service() method. Once
initialized the servlet remains in memory to process subsequent requests. So for every HTTP request service() method of the servlet is called.
Finally when server unloads the servlet from memory it calls the destroy() method which can be used to clean up any resource the servlet is
consuming.

The init() method

The init method is called by the servlet container after the servlet class has been instantiated. It is the point where servlet life begins. The servlet
container calls this method exactly once when the servlet was once loaded. In init method, the servlet creates and initializes the resources that it
will be using while handling requests.
The signature of this method is as follows:
public void init(ServletConfig sc)throws ServletException
init() method can throws a ServletException. If for some reason, the servlet cannot initialize the resources necessary to handle requests, the init()
method should throws a ServletException.

The service() Method:After the server is loaded and initializes the servlet, this method is called. This method is used to handle client request and server response. The
service method is called by the servlet container after the servlet init method to allow the servlet to respond to a request.
The signature of this method is as follows:
void service(ServletRequest req, ServletResponse res)throws ServletException,IOException
ServletRequest object is used to receive client request encapsulating information provided by the client and ServletResponse object is used to
send servlet response to the client.

The destroy() Method:This method is used to unload the servlet and all the resources which were allocated in init() method, should be released in destroy() method.
This method is called only once during the servlet life cycle. This method signifies the end of a servlets life. When service() method is being shut
down, it calla the servlet destroy() method.
The signature of this method is as follows:
public void destroy()

Initialization

request
Service

response

Destruction

Figure: Life Cycle of the Servlet


6. Tables Used in database
We used MySql database to store data of project . We used the following tables in the database
used in our project of Room Rental System :Admin
Pratapnagar
Jawaharnagar
Chandpol
Mansarowar
Shiprapath
Jothwada

Kukas
Malviyanagar

7. Getting Started
Initial steps are :-

1. Installing of latest version of jdk( java development kit ).


2. Installing of Apache Tomcat .
3. Now set three variables :- path , classpath ,JAVA_HOME
Path :- for JDK kit
# MyComputer -> Properties -> Advanced -> environment variables ->
# variable name : path
# variable value : path of jdk bin folder

Fig. setting the path for jdk bin


Java_home :- indicates javas home directory
# variable name : java_home
# variable value : path of jdk

user variables -> new

Fig. setting the JAVA_HOME path for JDK

Fig. 1 Starting page

Fig.2 Login for Admin

Fig.3 For Admin to change in records .

Fig.4 Searching Room by cost Range

6.

7. Conclusion
Thus we implemented the Room Rental System using jsp,css,javascript,html and a little servlet
technology and made easy to search the room in the jaipur city of rajasthan .

Anda mungkin juga menyukai