Project Report

Download as pdf or txt
Download as pdf or txt
You are on page 1of 48

MINI PROJECT

REPORT ON

“<RTO-Managment>”

Submitted By:
1. Vikas Gawande (8925)
2. Saurabh Kharkate (8889)

Submitted To

Savitribai Phule Pune University

As a partial fulfillment for the award of the degree of

MASTER OF COMPUTER APPLICATION


Semester: I

At
ASM‟s Institute of Business Management and Research,
Chinchwad, Pune – 19
Audyogik Shikshan Mandal‟s
(Society Regd. No. Maharashtra/ 1330/ Pune 83; Public Trust No. F-2451/ Pune 83)
INSTITUE OF BUSINESS MANAGEMENT AND RESEARCH, MCA, PUNE
Approved by AICTE, Govt. of India & Affiliated to Savitribai Phule Pune University

Ref. No. ASM/IBMR/MCA Date:

CERTIFICATE

This is to certify that the mini project entitled


“<RTO-Managment>”
is a bonafide work and it is submitted to the
Savitribai Phule Pune University

By
1. Vikas Gawande (8925)
2. Saurabh Kharkate (8889)

in the partial fulfilment of the degree of Master of Computer


Application, during the academic year 2023-2024.

Master of Computer Application,


ASM‟s Institute of Business Management and Research, MCA,
Chinchwad

Session 2023-2024
DECLARATION

I hereby declare that the present mini-project “<RTO-Managment >” is


original work carried out at ASM’s Institute of Business Management
and Research, MCA, Chinchwad. It has not been submitted by me in
part or in full to any university for any examination before. This work
has been carried out by me at Savitribai Phule Pune University during
the academic session 2023- 2024.

Date:

1. Vi kas Ga wa nde (8925)

2. Saurabh Kharkate (8889)

(MCA I Semester)
Department of Master of Computer Application,
ASM’s Institute of Business Management and Research, MCA,
Chinchwad
Audyogik Shikshan Mandal‟s
(Society Regd. No. Maharashtra/ 1330/ Pune 83; Public Trust No. F-2451/ Pune 83)
INSTITUE OF BUSINESS MANAGEMENT AND RESEARCH, MCA, PUNE
Approved by AICTE, Govt. of India & Affiliated to Savitribai Phule Pune University

Ref. No. ASM/IBMR/MCA Date:

EXAMINER CERTIFICATE

This is to certify that the mini project on


“<RTO-Managment>”

of MCA, semester - I

is examined by the following examiners on date / / 2023.

HOD
(MCA Department)

Internal Examiner External Examiner

MIDC, Block „C‟ Chinchwad Pune – 411019


Tel +91 – 020 – 27475090 / 27478666 | Fax +91 – 020 – 27471753 | www.asmedu.org | Email: [email protected]
ACKNOWLEDGEMENT

It is a pleasure to acknowledge the assistance of several people and institutions in this

effort. Honestly speaking, this project has turned me into a debtor. First and foremost,

I feel indebted to my guide and all the faculty members of Department of MCA,

ASM’s IBMR-MCA, Chinchwad for their valuable guidance, continuous support and

advice and constant encouragement throughout my project work.

I would like to extend my gratitude to honorable Dr. V. P. Pawar Sir, Director,

ASM‟s IBMR, MCA, Chinchwad for being a constant source of inspiration.

Finally, I would like to extend my thanks to all those who have contributed, directly

or indirectly to make this project successful.

Vikas Gawande (8925)


Saurabh Kharkate (8889)
Index
Sr.no Topic Page No.
Chapter 1: INTRODUCTION
1.1 Introduction 7
1.2 Objectives of the Project 7
1.3 Scope Of the Project 8
1.4 Intended Audience and Document Overview 8
Chapter 2: PROPOSED SYSTEM
2.1 Literature Survey 9
2.2 Existing System 10
2.3 Proposed System 11
2.4 Feasibility Study 12

2.5 Specific Requirements 13

2.6 Project Modules 14


Chapter 3:ANALYSIS & DESIGN
3.1 Use-Case Diagram 15
3.2 Data Flow Diagram 17
3.3 E-R Diagram 20
3.4 Sequence Diagram 21
3.5 Screen Layout 22
3.6 Table Design 28
3.7 Test Procedures 30
3.8 Future Scope 33
3.9 Sample Code 34
Chapter 4:CONCLUSION
4.1 Limitation & Conclusion 44-45
4.2 Bibliography 46
1 )INTRODUCTION:

1.1 Introduction:

As we know, if a user wants to apply for Driving License


whether it is for Two- wheelers or four-wheelers one has to go through lots
of paperwork by physically going to the RTO office and waiting in the queue
to get your work done. So, this could be a tiresome procedure for users as
well as for the offices at the ROT office. To avoid this situation, this web
application provides you a platform for managing RTO-related services.

Admin here is the main user of this application, who will


Accept & verify the applicant's request for a License and can view and update
the Vehicles Registered. Now, we have another user who is the applicant who
is going to apply for the Driving License. Not only this, Users can also
register their vehicles using this application.

This application will help the users to manage the process


of registration of vehicles seamlessly. The purpose of this project is not only
to make the RTO process less tiresome but to create one storage place for all
the information concerning one of the users' vehicle information as well as
Driving License related information.

1.2 Objectives of the Project:

Today, everything is going digital, like from shopping to


studies so why not we should make the process of Regional Transport Offices
system Online. For this, an RTO management project is designed. It provides
a platform for Admin (where admin can be any staff of your RTO office) as
well to users to improve the service of registration of vehicles and license.

Here, Admin can accept/reject the driving license


request, and users can apply for a driving license and also can register their
vehicles on this particular site. The main objective here is to replace the
manual process of registering for Vehicles and applying for a driving license
by waiting in the queue.
1.3 Scope Of the Project:

The Smart Plate project aims to develop a user-friendly web


application for ANPR, focusing on Unauthorized Vehicle detection, automatic
number plate detection and recognition, user management, and
comprehensive vehicle information retrieval. The scope includes limitations
such as manual image uploads and excludes real-time streaming video
detection.

1.4 References :

https://platerecognizer.com/
https://parklio.com/
2)PROPOSED SYSTEM:

2.1 Specific Requirements:

Software Environment:

Tools/Technology Front-end - HTML, CSS, JavaScript

Back-end - MongoDB, Java

Browser - Microsoft Edge, Firefox, Google


Chrome

Other - Docker

Operating System Windows 11 / Linux

Hardware Environment:

Client Configuration:

 Any CPU intel/ Ryzen


 Operating System: Windows 11 /2021
 RAM : 4GB minimum
 Any Browser : Chrome, Firefox, etc.

Server Configuration:

Servers, each with following configuration

 CPU
 Operating System: Linux
 RAM :8GB Minimum
 40GB Minimum Free Space on Drive
 750MHz
2.2) Project Module:

1)Admin-

 Admin can ADD/VIEW/UPDATE/DELETE Users.


 Admin can VIEW/UPDATE/DELETE Vehicle Information.
 Admin can VIEW/ACCEPT/REJECT/DELETE the Driving License
Request.
 Admin can change Password.
 Admin can VIEW/UPDATE Profile.

2)Users-
 Users can register their vehicles information.
 Users can apply for Driving License.
 Users can view the status of License.
 Users can change the password.
Users can VIEW/UPDATE Profile

2.3)Feasibility Study:
This project will be developed on computer, so first check
whether the technology is technically available or not. Now a day’s
computer interaction with any job becomes common for any kind of job or
work.
And because of increasing usage of Computer, Computer is also available
with a variety of hardware. Vendors can fulfill any type of hardware
requirement. The whole project is developed by some special tools or by
using languages and databases, which are also available in a variety.
Preliminary investigation of a system examines the feasibility of a
system that is useful to an organization. It is the first phase of system
development.
The main objective of this phase is to identify the current deficiencies
in the user’s environment and to determine which existing problem are
going to be solve in proposed system and also which new function needs to
be added in proposed system.
An important outcome of such preliminary investigation is to
determine whether the system that will meet all needed requirements.

Thus, three tests are carried out on the system namely operation,
technical and economical.
Any project is beneficial if and only satisfies the organization
requirement. For any new system setup, it only meets to be communicated
and work the other supporting system.
The new system meets all existing operations since it provides right
information at a right time to the right user. A Leigh man can easily operate
with the system. Technical Feasibility examines whether the technology
needed is available and if it is available then it feasible to carry out all
project activities.
The technical needs of a system include:
• The facility to produce outputs in a given time.
• Ability to process large number of transactions at a particular speed.
Giving response to users under certain conditions.

The technology needed for our system is mainly:

• Latest version of browsers.


• Any operating system.

These technologies are available which helps to carry out the system
efficiently. Economic feasibility of a system examines whether the finance is
available for implementing the new system and whether the money spent is
recoverable the satisfaction. The cost involves is in designing and developing
a good investment for the organization. Thus, hardware requirements used
for proposed system are very standard. Moreover, by making use of proposed
system to carry out the work speedily will increase and also saves the
valuable time of an organization.
In the proposed system the finance is highly required for the installation
of the software’s which can also be recovered by implementing a better
system.
3) ANALYSIS & DESIGN:
3.1) Use-Case Diagram:
3.2) Data Flow Diagram:
3.3)ER Diagram:
3.4)Sequence Diagram:
3.5)Database Design:

3
3.5)Screen Layout:
3.5)Sample Code:
Controller:
UserRegistrationCtl:
package com.rto.controller;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Logger;
import com.rto.bean.BaseBean;
import com.rto.bean.UserBean;
import com.rto.exception.ApplicationException;
import com.rto.exception.DatabaseException;
import com.rto.exception.DuplicateRecordException;
import com.rto.model.UserModel;
import com.rto.util.DataUtility;
import com.rto.util.DataValidator;
import com.rto.util.PropertyReader;
import com.rto.util.ServletUtility
/**
* Servlet implementation class UserRegistrationCtl
*/
@WebServlet(name="UserRegistrationCtl",urlPatterns={"/register"})
public class UserRegistrationCtl extends BaseCtl {
private static final long serialVersionUID = 1L;
public static final String OP_SIGN_UP = "SignUp";
private static Logger log = Logger.getLogger(UserRegistrationCtl.class);
/**
* @see HttpServlet#HttpServlet()
*/
public UserRegistrationCtl() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected boolean validate(HttpServletRequest request)
{
boolean pass=true;
String username=request.getParameter("uname");
if(DataValidator.isNull(request.getParameter("name"))){
request.setAttribute("name",PropertyReader.getValue("error.require", "name"));
pass=false;
}
else if(!DataValidator.isName(request.getParameter("name")))
{
request.setAttribute("name",PropertyReader.getValue("error.name", "name"));
pass=false;
}
if(DataValidator.isNull(username)){
request.setAttribute("username", PropertyReader.getValue("error.require","username"));
pass=false;
}
if(DataValidator.isNull(request.getParameter("password"))){
request.setAttribute("password", PropertyReader.getValue("error.require", "password"));
pass=false;
}
else if(!DataValidator.isPassword(request.getParameter("password"))){
request.setAttribute("password", PropertyReader.getValue("error.password", "password"));
pass=false;
}
if(DataValidator.isNull(request.getParameter("emailid"))){
request.setAttribute("emailid", PropertyReader.getValue("error.require", "emailid"));
pass=false;
}
else if(!DataValidator.isEmail(request.getParameter("emailid"))){
request.setAttribute("emailid", PropertyReader.getValue("error.emailid", "emailid"));
pass=false;
}
if(DataValidator.isNull(request.getParameter("contact"))){
request.setAttribute("contact", PropertyReader.getValue("error.require", "contact"));
pass=false;
}
else if(!DataValidator.isPhoneNo(request.getParameter("contact"))){
request.setAttribute("contact", PropertyReader.getValue("error.invalid", "contact"));
pass=false;
}
return pass;
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws
ServletException, IOException {
// TODO Auto-generated method stub
String op=DataUtility.getString(request.getParameter("operation"));
UserModel model=new UserModel();

int id=DataUtility.getInt(request.getParameter("id"));

if(id>0 || op!=null){
UserBean bean=null;
try {
bean = model.findByPK(id);
} catch (ApplicationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
ServletUtility.setBean(bean, request);
}
ServletUtility.forward(getView(), request, response);
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws
ServletException, IOException {
// TODO Auto-generated method stub
String op=DataUtility.getString(request.getParameter("operation"));
UserModel model=new UserModel();

int id=DataUtility.getInt(request.getParameter("id"));
System.out.println("Id in do psot"+id);
if(OP_SIGN_UP.equalsIgnoreCase(op))
{
UserBean bean=(UserBean)populateBean(request);
try {
System.out.println("in try sign up");
int pk = model.registerUser(bean);
System.out.println("value of pk is "+pk);
//System.out.println("in register");
bean.setId(pk);
request.getSession().setAttribute("UserBean", bean);
ServletUtility.setSuccessMessage("User Successfully Registered", request);
ServletUtility.forward(RTOView.User_Registration_View, request, response);
return;
} catch (DuplicateRecordException e) {
log.error(e);
ServletUtility.setBean(bean, request);
ServletUtility.setErrorMessage("Username already exist!!",request);
ServletUtility.forward(getView(), request, response);
} catch (ApplicationException e) {
ServletUtility.handleException(e, request, response);
e.printStackTrace();
return;
} catch (DatabaseException e) {
e.printStackTrace();
}
}else if (OP_RESET.equalsIgnoreCase(op)) {
ServletUtility.redirect(RTOView.User_Registration_Ctl, request, response);
return;
}
}
protected BaseBean populateBean(HttpServletRequest request) {
// TODO Auto-generated method stub
UserBean bean=new UserBean();
bean.setId(DataUtility.getInt(request.getParameter("id")));
bean.setUserName(DataUtility.getString(request.getParameter("uname")));
bean.setName(DataUtility.getString(request.getParameter("name")));
bean.setPassword(DataUtility.getString(request.getParameter("password")));
bean.setEmailid(DataUtility.getString(request.getParameter("emailid")));
bean.setContactno(DataUtility.getString(request.getParameter("contact")));
bean.setRoleid(2);
populateDTO(bean, request);
return bean;
}
protected String getView() {
return RTOView.User_Registration_View;
}
}
Vehicle RegistartionCtl:
package com.rto.controller;
import java.io.IOException;import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.rto.bean.BaseBean;
import com.rto.bean.VehicleBean;
import com.rto.exception.ApplicationException;
import com.rto.exception.DuplicateRecordException;
import com.rto.model.VehicleModel;
import com.rto.util.DataUtility;
import com.rto.util.DataValidator;
import com.rto.util.PropertyReader;
import com.rto.util.ServletUtility;

/**
* Servlet implementation class VehicleRegistrationCtl
*/
@WebServlet(name="VehicleRegistrationCtl",urlPatterns={"/ctl/VehicleRegister"})
public class VehicleRegistrationCtl extends BaseCtl {
private static final long serialVersionUID = 1L;
public static final String OP_SIGN_UP = "SignUp";
/**
* @see HttpServlet#HttpServlet()
*/
public VehicleRegistrationCtl() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws
ServletException, IOException {
// TODO Auto-generated method stub
ServletUtility.forward(getView(), request, response);
}
@Override
protected boolean validate(HttpServletRequest request) {
// TODO Auto-generated method stub
boolean pass=true;
if(DataValidator.isNull(request.getParameter("typeofvehicle"))){
request.setAttribute("typeofvehicle", PropertyReader.getValue("error.require","typeofvehicle"));
pass=false;
}
if(DataValidator.isNull(request.getParameter("name"))){
request.setAttribute("name", PropertyReader.getValue("error.require","name"));
pass=false;
}
else if(!DataValidator.isName(request.getParameter("name"))){
request.setAttribute("name", PropertyReader.getValue("error.name","name"));
pass=false;
}

//Validation for Registration Number.


if(DataValidator.isNull(request.getParameter("regno"))){
request.setAttribute("regno", PropertyReader.getValue("error.require","regno"));
pass=false;
}
else if(!DataValidator.isRegNo(request.getParameter("regno"))){
request.setAttribute("regno",PropertyReader.getValue("error.regno","regno"));
pass=false;
}
//Validation for dates
if(DataValidator.isNull(request.getParameter("dor"))){
request.setAttribute("dor", PropertyReader.getValue("error.require","dor"));
pass=false;
}
//Valiadtion for chasssis
if(DataValidator.isNull(request.getParameter("cno"))){
request.setAttribute("cno", PropertyReader.getValue("error.require","cno"));
pass=false;
}
else if(!DataValidator.isInteger(request.getParameter("cno"))){
request.setAttribute("cno",PropertyReader.getValue("error.cno","cno"));
pass=false;
}
//validation Model Name

if(DataValidator.isNull(request.getParameter("modelname"))){
request.setAttribute("modelname", PropertyReader.getValue("error.require","modelname"));
pass=false;
}
else if(!DataValidator.isName(request.getParameter("modelname"))){
request.setAttribute("modelname",PropertyReader.getValue("error.name","modelname"));
pass=false;
}
return pass;
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
@Override
protected BaseBean populateBean(HttpServletRequest request) {
// TODO Auto-generated method stub
VehicleBean bean=new VehicleBean();
bean.setId(DataUtility.getInt(request.getParameter("id")));
bean.setTypeOfVehicle(DataUtility.getString(request.getParameter("typeofvehicle")));
bean.setOwnerName(DataUtility.getString(request.getParameter("name")));
bean.setRegistrationNo(DataUtility.getString(request.getParameter("regno")));
bean.setRegistrationDate(DataUtility.getDate(request.getParameter("dor")));
bean.setChassisNo(DataUtility.getString(request.getParameter("cno")));
bean.setModelName(DataUtility.getString(request.getParameter("modelname")));
populateDTO(bean, request);

return bean;
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws
ServletException, IOException {
// TODO Auto-generated method stub
String op=DataUtility.getString(request.getParameter("operation"));
System.out.println("op is "+op);
VehicleModel model=new VehicleModel();
int id=DataUtility.getInt(request.getParameter("id"));
if(OP_SIGN_UP.equalsIgnoreCase(op)){
VehicleBean bean=(VehicleBean)populateBean(request);
try {
int pk=model.registerVehicle(bean);
request.getSession().setAttribute("VehicleBean", bean);
ServletUtility.setSuccessMessage("Vehicle Successfully Registered", request);
ServletUtility.forward(getView(), request, response);
return;
} catch (ApplicationException e) {
// TODO Auto-generated catch block
ServletUtility.handleException(e, request, response);
e.printStackTrace();
return;
} catch (DuplicateRecordException e) {
// TODO Auto-generated catch block
e.printStackTrace();
//log.error(e);
ServletUtility.setBean(bean, request);
ServletUtility.setErrorMessage("Vehicle already Exist",
request);
ServletUtility.forward(getView(), request, response);
}
}
}
@Override
protected String getView() {
// TODO Auto-generated method stub
return RTOView.Vehicle_Registration_View;
}
}

LicenseRegistartionCtl:

package com.rto.controller;

import java.io.IOException;

import java.io.InputStream;

import java.sql.Blob;

import java.sql.SQLException;

import javax.servlet.ServletException;

import javax.servlet.annotation.MultipartConfig;

import javax.servlet.annotation.WebServlet;

import javax.servlet.http.HttpServlet;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;

import javax.servlet.http.Part;

import javax.sql.rowset.serial.SerialBlob;

import javax.sql.rowset.serial.SerialException;

import org.apache.lucene.util.IOUtils;
import com.rto.bean.BaseBean;

import com.rto.bean.LicenceBean;

import com.rto.exception.ApplicationException;

import com.rto.exception.DuplicateRecordException;

import com.rto.model.LicenceModel;

import com.rto.util.DataUtility;

import com.rto.util.DataValidator;

import com.rto.util.PropertyReader;

import com.rto.util.ServletUtility;

/**

* Servlet implementation class LicenceRegisterCtl

*/

@MultipartConfig(maxFileSize = 16177215)

@WebServlet(name="LicenceRegisterCtl",urlPatterns={"/ctl/Licence"})

public class LicenceRegisterCtl extends BaseCtl {

private static final long serialVersionUID = 1L;

public static final String OP_SIGN_UP = "SignUp";

/**

* @see HttpServlet#HttpServlet()

*/

public LicenceRegisterCtl() {

super();

// TODO Auto-generated constructor stub

/**

* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)

*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws
ServletException, IOException {

// TODO Auto-generated method stub

ServletUtility.forward(getView(), request, response);

/**

* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)

*/

@Override

protected BaseBean populateBean(HttpServletRequest request) {

// TODO Auto-generated method stub

LicenceBean bean=new LicenceBean();

bean.setId(DataUtility.getInt(request.getParameter("id")));

bean.setApplicantName(DataUtility.getString(request.getParameter("applicantname")));

bean.setGender(DataUtility.getString(request.getParameter("gender")));

bean.setDob(DataUtility.getDate(request.getParameter("dob")));

bean.setPlaceOfBirth(DataUtility.getString(request.getParameter("pob")));

bean.setAddress(DataUtility.getString(request.getParameter("address")));

bean.setTypeOfLicence(DataUtility.getString(request.getParameter("licence")));

bean.setStatus(" ");

InputStream inputStream=null;

Blob blob=null;

try {

//input stream of the uploaded file...

Part filepart=request.getPart("photo");
inputStream =filepart.getInputStream();

byte[] b=new byte[inputStream.available()];

inputStream.read(b);

try {

blob = new SerialBlob(b );

} catch (SerialException e) {

// TODO Auto-generated catch block

e.printStackTrace();

} catch (SQLException e) {

// TODO Auto-generated catch block

e.printStackTrace();

} catch (IOException | ServletException e) {

// TODO Auto-generated catch block

e.printStackTrace();

bean.setPhoto(blob);

populateDTO(bean, request);

return bean;

@Override

protected boolean validate(HttpServletRequest request) {

// TODO Auto-generated method stub

boolean pass=true;

if(DataValidator.isNull(request.getParameter("applicantname"))){

request.setAttribute("applicant",
PropertyReader.getValue("error.require","Name of Applicant"));
pass=false;

else if(!DataValidator.isName(request.getParameter("applicantname"))){

request.setAttribute("name", PropertyReader.getValue("error.name","name"));

pass=false;

if ("-----Select-----".equalsIgnoreCase(request.getParameter("gender"))) {

request.setAttribute("gender",

PropertyReader.getValue("error.require", "Gender"));

pass = false;

if (DataValidator.isNull(request.getParameter("dob"))) {

request.setAttribute("dob",

PropertyReader.getValue("error.require", "Date of Birth"));

pass = false;

} else if (!DataValidator.isDate(request.getParameter("dob"))) {

request.setAttribute("dob","Min Age Must be 17 years");

pass = false;

if(DataValidator.isNull(request.getParameter("pob"))){

request.setAttribute("pob", PropertyReader.getValue("error.require","Place of
Birth"));

pass=false;

else if(!DataValidator.isName(request.getParameter("pob"))){

request.setAttribute("name", PropertyReader.getValue("error.name","name"));

pass=false;}
if(DataValidator.isNull(request.getParameter("address"))){

request.setAttribute("name",
PropertyReader.getValue("error.require","Address"));

pass=false;

else if(!DataValidator.isName(request.getParameter("address"))){

request.setAttribute("name", PropertyReader.getValue("error.name","name"));

pass=false;

if ("-----Select-----".equalsIgnoreCase(request.getParameter("licence"))) {

request.setAttribute("licence",

PropertyReader.getValue("error.require", "Licence"));

pass = false;

return pass;

protected void doPost(HttpServletRequest request, HttpServletResponse response) throws


ServletException, IOException {

// TODO Auto-generated method stub

System.out.println("helloe");

String op=DataUtility.getString(request.getParameter("operation"));

System.out.println("in op of dopost"+op);

LicenceModel model=new LicenceModel();

int id=DataUtility.getInt(request.getParameter("id"));

if(OP_SIGN_UP.equalsIgnoreCase(op)){

LicenceBean bean=(LicenceBean)populateBean(request);

/*InputStream inputStream=null; //input stream of the uploaded file...


Part filepart=request.getPart("photo");

inputStream =filepart.getInputStream();*/

try {

int pk=model.registerApplicant(bean);

request.getSession().setAttribute("LicenceBean", bean);

ServletUtility.setSuccessMessage("Thank You!! Admin will verify the


Information", request);

ServletUtility.forward(getView(), request, response);

return;

} catch (ApplicationException e) {

// TODO Auto-generated catch block

e.printStackTrace();

} catch (DuplicateRecordException e) {

// TODO Auto-generated catch block

e.printStackTrace();

ServletUtility.setBean(bean, request);

ServletUtility.setErrorMessage("Application Already Exist",

request);

ServletUtility.forward(getView(), request, response);

} catch (SQLException e) {

// TODO Auto-generated catch block

e.printStackTrace();

@Override

protected String getView() {


// TODO Auto-generated method stub

return RTOView.Licence_Registration_View;

ChangePasswordCtl:

package com.rto.controller;

import java.io.IOException;

import javax.servlet.ServletException;

import javax.servlet.annotation.WebServlet;

import javax.servlet.http.HttpServlet;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;

import javax.servlet.http.HttpSession;

import com.rto.bean.BaseBean;

import com.rto.bean.UserBean;

import com.rto.exception.ApplicationException;

import com.rto.exception.RecordNotFoundException;

import com.rto.model.UserModel;

import com.rto.util.DataUtility;

import com.rto.util.DataValidator;

import com.rto.util.PropertyReader;

import com.rto.util.ServletUtility;

/**

* Servlet implementation class ChangePasswordCtl

*/
@WebServlet(name="ChangePasswordCtl",urlPatterns="/ctl/ChangePasswordCtl")

public class ChangePasswordCtl extends BaseCtl {

private static final long serialVersionUID = 1L;

/**

* @see HttpServlet#HttpServlet()

*/

public ChangePasswordCtl() {

super();

// TODO Auto-generated constructor stub

/**

* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)

*/

@Override

protected boolean validate(HttpServletRequest request) {

// TODO Auto-generated method stub

boolean pass=true;

String op=DataUtility.getString(request.getParameter("operation"));

if (DataValidator.isNull(request.getParameter("old"))) {

request.setAttribute("old", PropertyReader.getValue("error.require", "Old


Password"));

pass = false;

}else if (!DataValidator.isPassword(request.getParameter("old"))) {

request.setAttribute("old", PropertyReader.getValue("error.password", "Old


Password"));

return false;

}
if (DataValidator.isNull(request.getParameter("new"))) {

request.setAttribute("new", PropertyReader.getValue("error.require", "New


Password"));

pass = false;

} else if (!DataValidator.isPassword(request.getParameter("new"))) {

request.setAttribute("new", PropertyReader.getValue("error.password", "New


Password"));

return false;

return pass;

@Override

protected BaseBean populateBean(HttpServletRequest request) {

// TODO Auto-generated method stub

UserBean bean=new UserBean();

bean.setPassword(DataUtility.getString(request.getParameter("old")));

bean.setPassword(DataUtility.getString(request.getParameter("new")));

return bean;

protected void doGet(HttpServletRequest request, HttpServletResponse response) throws


ServletException, IOException {

// TODO Auto-generated method stub

ServletUtility.forward(getView(), request, response);

}
/**

* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)

*/

protected void doPost(HttpServletRequest request, HttpServletResponse response) throws


ServletException, IOException {

// TODO Auto-generated method stub

HttpSession session=request.getSession();

String op=DataUtility.getString(request.getParameter("operation"));

UserModel model=new UserModel();

UserBean bean=(UserBean)session.getAttribute("user");

String newPass=request.getParameter("new");

String oldPass=request.getParameter("old");

int id=bean.getId();

if(OP_SAVE.equalsIgnoreCase(op)){

try {

boolean flag=model.changepassword(id,oldPass,newPass);

if (flag == true) {

bean = model.findByLogin(bean.getUserName());

session.setAttribute("user", bean);

ServletUtility.setBean(bean, request);

ServletUtility.setSuccessMessage("Password changed
Successfully", request);

} catch (RecordNotFoundException e) {

// TODO Auto-generated catch block


e.printStackTrace();

ServletUtility.setErrorMessage("Please enter valid OLd Password",


request);

} catch (ApplicationException e) {

// TODO Auto-generated catch block

e.printStackTrace();

ServletUtility.forward(getView(), request, response);

@Override

protected String getView() {

// TODO Auto-generated method stub

return RTOView.CHANGE_PASS_VIEW;

VehicleBean:

package com.rto.bean;

import java.util.Date;

import javax.persistence.Column;

import javax.persistence.Entity;

import javax.persistence.Table;

@Entity

@Table(name="r_vehicle")
public class VehicleBean extends BaseBean {

@Column(name="typeofvehicle",length=45)

private String typeOfVehicle;

@Column(name="ownername",length=45)

private String ownerName;

@Column(name="registrationno", length=45)

private String registrationNo;

@Column(name="registrationdate")

private Date registrationDate;

@Column(name="chassisno", length=45)

private String chassisNo;

@Column(name="modelname", length=45)

private String modelName;

public String getTypeOfVehicle() {

return typeOfVehicle;

public void setTypeOfVehicle(String typeOfVehicle) {

this.typeOfVehicle = typeOfVehicle;

}
public String getOwnerName() {

return ownerName;

public void setOwnerName(String ownerName) {

this.ownerName = ownerName;

public String getRegistrationNo() {

return registrationNo;

public void setRegistrationNo(String registrationNo) {

this.registrationNo = registrationNo;

public Date getRegistrationDate() {

return registrationDate;

public void setRegistrationDate(Date registrationDate) {

this.registrationDate = registrationDate;

public String getChassisNo() {

return chassisNo;
}

public void setChassisNo(String chassisNo) {

this.chassisNo = chassisNo;

public String getModelName() {

return modelName;

public void setModelName(String modelName) {

this.modelName = modelName;

LicenseBean:
package com.rto.bean;

import java.io.InputStream;

import java.sql.Blob;

import java.util.Date;

import javax.persistence.Column;

import javax.persistence.Entity;

import javax.persistence.Table;

@Entity

@Table(name="r_licence")
public class LicenceBean extends BaseBean{

@Column(name="applicantname",length=45)

private String applicantName;

@Column(name="gender",length=45)

private String gender;

@Column(name="dob",length=45)

private Date dob;

@Column(name="status")

private String status;

@Column(name="placeofbirth",length=45)

private String placeOfBirth;

@Column(name="address",length=145)

private String address;

@Column(name="typeoflicence",length=45)

private String typeOfLicence;

@Column(name="photo")

private Blob photo;

public String getApplicantName() {

return applicantName;
}

public void setApplicantName(String applicantName) {

this.applicantName = applicantName;

public String getGender() {

return gender;

public void setGender(String gender) {

this.gender = gender;}

public Date getDob() {

return dob;

public void setDob(Date dob) {

this.dob = dob;

public String getPlaceOfBirth() {

return placeOfBirth;

public void setPlaceOfBirth(String placeOfBirth) {

this.placeOfBirth = placeOfBirth;

public String getAddress() {

return address;}

public void setAddress(String address) {

this.address = address;

public String getTypeOfLicence() {


return typeOfLicence;

public void setTypeOfLicence(String typeOfLicence) {

this.typeOfLicence = typeOfLicence;

public Blob getPhoto() {

return photo;

public void setPhoto(Blob inputStream) {

this.photo = inputStream;

public String getStatus() {

return status;

public void setStatus(String status) {

this.status = status;

}
4:CONCLUSION:
4.1)Limitation & Conclusion:

Limitation:
Futures Enhancement:
 In future we can expand this project on the web.
 We can make another module where can generate the License card to user.

Limitation :
 In this, we have only one admin section. In future we can make another login for
officers.

Conclusion:

This project helps to replace the manual process of registration for


License and vehicle. The whole purpose lies here is to make the RTO
management process less tiresome and to make storage where we can have
the user's vehicle information as well as the License Information in one place
and easily accessible when needed.
This project can be used by the RTO offices to manage the process
effortlessly and the long queue of users, the paperwork things can be avoided
here
This application is designed in such a way that any future
modification can be done most easily.

You might also like