Web Application Design and Development using JSP, Servlets, and MySQL
VerifiedAdded on 2019/09/26
|18
|2498
|332
Practical Assignment
AI Summary
This assignment presents a detailed overview of a web application developed using JSP, Servlets, and MySQL. The solution begins with an introduction to the object-oriented approach and the technologies employed, including JSP, Servlets, and MySql as the backend database. It then delves into the design and coding techniques, highlighting the use of the singleton design pattern and a partial object-oriented approach. The document explains the rationale behind these choices, providing code snippets and examples of the interaction between JSP forms and Servlet classes. The architecture model, issues, and suggestions for improvement, including the application of MVC pattern and EJB design patterns, are also discussed. The assignment concludes with a critical analysis of the solution, addressing potential issues and proposing improvements. Furthermore, the document includes a detailed breakdown of the application's components, such as index.jsp, register.jsp, and various servlet classes, illustrating the data flow and functionality of the web application.

Contents
Overview of approach to development and general rational......................................................................1
Detail of design and coding techniques used and reasoning behind their use............................................1
The design/coding techniques:................................................................................................................1
Why I chose this technique:....................................................................................................................1
Evidence:.................................................................................................................................................1
Conclusion:..........................................................................................................................................2
Architecture Model.....................................................................................................................................2
Critical analysis of solution..........................................................................................................................2
Issues:......................................................................................................................................................2
Suggestion:..............................................................................................................................................3
Suggested use of design patterns................................................................................................................3
Jsp/Servlet Pattern with HTML................................................................................................................3
EJB design patterns..................................................................................................................................4
References...................................................................................................................................................6
Overview of approach to development and general rational......................................................................1
Detail of design and coding techniques used and reasoning behind their use............................................1
The design/coding techniques:................................................................................................................1
Why I chose this technique:....................................................................................................................1
Evidence:.................................................................................................................................................1
Conclusion:..........................................................................................................................................2
Architecture Model.....................................................................................................................................2
Critical analysis of solution..........................................................................................................................2
Issues:......................................................................................................................................................2
Suggestion:..............................................................................................................................................3
Suggested use of design patterns................................................................................................................3
Jsp/Servlet Pattern with HTML................................................................................................................3
EJB design patterns..................................................................................................................................4
References...................................................................................................................................................6
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

Overview of approach to development and general rational
I have used object oriented approach. . I have used Jsp and servlet technology to develop
this application. I have used MySql as backend database.All forms are separately
designed and their actions are performed by Servlet classes and they are separately
related to different Jsp pages
Detail of design and coding techniques used and reasoning behind their
use
I have used singleton design pattern.
Coding Techniques:
The design/coding techniques: I have followed partial object oriented approach.
Why I chose this technique: My application is not so big and also only I have
designed this whole code. This project is not so big. This has simple and little
functionality to implement so I make this simple by implementing very basic coding
techniques.
Evidence: as you can see in my code there are only two types of file I used and they are
: Jsp and Servlet type. In this project, all Jsp files are located in WEB-INF folder which
represents the web forms where users can interact with my web application. And all
servlet classes are placed in Source Packages’ default packages; here my all servlet
classes are model type these interact with database and perform all actions and direct
contact with Jsp forms by calling them. In my project code there are no controller classes
because my web application is very simple with the little functionalities so all Jsp forms
directly interact with the Servlet classes and all Servlet classes directly interact with Jsp
forms.
For example:
register.jsp form directly interacts with the AddNewUser.java Servlet class
When user fill the all details mentioned in the register.jsp form and click on
register button then form action call will redirect to AddNewUser.java Servlet
class where all parameters are get and then they are saved to database and after
this the call is redirect to index.jsp where user can login and can go further related
pages.
When user click on the login button then other login.jsp page is called and the
user will be identified in this page and then call will be redirect to that page which
I have used object oriented approach. . I have used Jsp and servlet technology to develop
this application. I have used MySql as backend database.All forms are separately
designed and their actions are performed by Servlet classes and they are separately
related to different Jsp pages
Detail of design and coding techniques used and reasoning behind their
use
I have used singleton design pattern.
Coding Techniques:
The design/coding techniques: I have followed partial object oriented approach.
Why I chose this technique: My application is not so big and also only I have
designed this whole code. This project is not so big. This has simple and little
functionality to implement so I make this simple by implementing very basic coding
techniques.
Evidence: as you can see in my code there are only two types of file I used and they are
: Jsp and Servlet type. In this project, all Jsp files are located in WEB-INF folder which
represents the web forms where users can interact with my web application. And all
servlet classes are placed in Source Packages’ default packages; here my all servlet
classes are model type these interact with database and perform all actions and direct
contact with Jsp forms by calling them. In my project code there are no controller classes
because my web application is very simple with the little functionalities so all Jsp forms
directly interact with the Servlet classes and all Servlet classes directly interact with Jsp
forms.
For example:
register.jsp form directly interacts with the AddNewUser.java Servlet class
When user fill the all details mentioned in the register.jsp form and click on
register button then form action call will redirect to AddNewUser.java Servlet
class where all parameters are get and then they are saved to database and after
this the call is redirect to index.jsp where user can login and can go further related
pages.
When user click on the login button then other login.jsp page is called and the
user will be identified in this page and then call will be redirect to that page which

user belong to, for example if user is admin then admin.jsp page will called or if
user is normal user(customer) then userPanel.jsp will called.
Conclusion: So there is bidirectional relatioin in my view classes and model classes because
there are no controller classes in between them. I followed this architecture because this project
is small and this become easy for me by designing this project in this manner.
Here are code snippets which are specifying which jsp form is linked which servlet class.
1. This is index.jsp page which shows a login page with the register here link.
If there is a new user then he/she go with “Register Here” link and then he/she can
register first
When user click on register here link then he/she will redirect to a different jsp page
that is for user registration.
user is normal user(customer) then userPanel.jsp will called.
Conclusion: So there is bidirectional relatioin in my view classes and model classes because
there are no controller classes in between them. I followed this architecture because this project
is small and this become easy for me by designing this project in this manner.
Here are code snippets which are specifying which jsp form is linked which servlet class.
1. This is index.jsp page which shows a login page with the register here link.
If there is a new user then he/she go with “Register Here” link and then he/she can
register first
When user click on register here link then he/she will redirect to a different jsp page
that is for user registration.
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

When user clicks on submit button then all the user information will saved by
AddNewUser.java class.
After successful registration the user will move to index.jsp page again where he/she
can login to get in the system or get his/her menu.
AddNewUser.java class.
After successful registration the user will move to index.jsp page again where he/she
can login to get in the system or get his/her menu.
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

2. When user choose to login and click on login button on index.jsp page then login
details are validate using login.jsp page. The code of this page is in the following
code snippet
If user is normal user then he/she will redirect to userPanel.jsp page, if he/she is
admin then user redirect to adminPanel.jsp page.
details are validate using login.jsp page. The code of this page is in the following
code snippet
If user is normal user then he/she will redirect to userPanel.jsp page, if he/she is
admin then user redirect to adminPanel.jsp page.

3. Here is the code for aminPanel
Here are three links
Upload image – if user click on this link the admin will redirect to
addOwnerDtls.jsp page
View Image- this link will redirect the admin to viewImgList.jsp
Logout- this link will redirect to logout.jsp page
4. addOwnerDtls.jsp
Here are three links
Upload image – if user click on this link the admin will redirect to
addOwnerDtls.jsp page
View Image- this link will redirect the admin to viewImgList.jsp
Logout- this link will redirect to logout.jsp page
4. addOwnerDtls.jsp
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

Here admin will fill the details of item owner personal details and when admin clicks on
next button then these details are saved into database by the
SaveImageOwnerDetailsServlet.java class
Here is the code snippet for this java class
When owner details are successfully saved into database then admin will redirect to
uploadImg.jsp page where admin will add item information and upload the item images
save them one by one for single owner.
5. When user click on add item then this item information is saved by the
uploadFileServlet.java class
If admin click on the go to menu then admin will redirect to his/her menu page.
If admin click on the add new owner details then admin redirect to that addOwnerDtls.jsp
page again where admin can add details for new Owner of the items.
next button then these details are saved into database by the
SaveImageOwnerDetailsServlet.java class
Here is the code snippet for this java class
When owner details are successfully saved into database then admin will redirect to
uploadImg.jsp page where admin will add item information and upload the item images
save them one by one for single owner.
5. When user click on add item then this item information is saved by the
uploadFileServlet.java class
If admin click on the go to menu then admin will redirect to his/her menu page.
If admin click on the add new owner details then admin redirect to that addOwnerDtls.jsp
page again where admin can add details for new Owner of the items.
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

6. uploadFileServlet.java
This is the java class which save the image file details and after that redirect the admin to
uploadImg.jsp again so that admin will able to add details for more item for one Owner.
7. viewImgList.jsp
if admin click on the view images then the whole list of images will be shown by this
viwImgList.jsp page.
At the end of the page a link “Go Back to Main Menu” is provided. After seeing the
image details then admin able to go his/her menu after clicking on this link.
This is the java class which save the image file details and after that redirect the admin to
uploadImg.jsp again so that admin will able to add details for more item for one Owner.
7. viewImgList.jsp
if admin click on the view images then the whole list of images will be shown by this
viwImgList.jsp page.
At the end of the page a link “Go Back to Main Menu” is provided. After seeing the
image details then admin able to go his/her menu after clicking on this link.

8. If admin click on logout link then all the session attributes are set to null and main
menu will display to user that is “index.jsp” page.
9. Normal user menu: userPanel.jsp
This is the user menu.
Here users are those persons who took part in item bidding.
If user clicks on “View Current Bidding Item List” then they will redirect to itemList.jsp
page
If user clicks on “View Notification” then they will redirect ot userNotification.jsp page
If user clicks on logout then the all session attributes are set to null that are realted to this
user and home page will display that is index.jsp page.
menu will display to user that is “index.jsp” page.
9. Normal user menu: userPanel.jsp
This is the user menu.
Here users are those persons who took part in item bidding.
If user clicks on “View Current Bidding Item List” then they will redirect to itemList.jsp
page
If user clicks on “View Notification” then they will redirect ot userNotification.jsp page
If user clicks on logout then the all session attributes are set to null that are realted to this
user and home page will display that is index.jsp page.
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

10. itemList.jsp
If user clicks on “view item list” then user able to view all bid items. At the end of the
page a link “Go Back to Main Menu” is provided for user. If user wants to go back to
his/her menu then user clicks on it.
11. If User wants to his/her notification then this page “userNotification.jsp” page will show
user notification if there any. Here user able to see that either he/she won the bid or loss
the bid and he/she can go for further process like payment and all.
If user clicks on “view item list” then user able to view all bid items. At the end of the
page a link “Go Back to Main Menu” is provided for user. If user wants to go back to
his/her menu then user clicks on it.
11. If User wants to his/her notification then this page “userNotification.jsp” page will show
user notification if there any. Here user able to see that either he/she won the bid or loss
the bid and he/she can go for further process like payment and all.
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser


Architecture Model
I have designed my code using this architecture model. In my code there are JSP forms some
JSP forms are for user where user interacts with this item auction web application and some
JSP forms are with java embedded code. This embedded code is to get data from the database
directly and save data into database by getting information from the JSP page. There are
some servlet classes for e.g. FileUploadDBServlet.java this class. This servlet class is called
by uploadImg.jsp when user select an image and to upload he/she click the submit button.
Then this servlet class first gets the uploaded file details and then save this file into database.
Here are some jsp files that are only for view purpose and servlet classes deal with the
all database query.
Register.jsp save the details for new user by calling servlet class that is
AddNewUser.java.
uploadImg.jsp is also called uploadFileServlet.java class to save the details. This
class saves all the details into database.
Here are the some .jsp files which are directly deal with the database queries.
viewImageList.jsp directly contact with the database and accessing the details of
image list.
viewImage.jsp is also doing same thing.
viewAnItemBidUserDetails.jsp, userNotification.jsp, ownerDetails.jsp, login.jsp and
itemList.jsp, these jsp forms are also directly dealing with the database quiries
without calling and servlet class. Here is the java code is embedded in the .jsp files.
I have designed my code using this architecture model. In my code there are JSP forms some
JSP forms are for user where user interacts with this item auction web application and some
JSP forms are with java embedded code. This embedded code is to get data from the database
directly and save data into database by getting information from the JSP page. There are
some servlet classes for e.g. FileUploadDBServlet.java this class. This servlet class is called
by uploadImg.jsp when user select an image and to upload he/she click the submit button.
Then this servlet class first gets the uploaded file details and then save this file into database.
Here are some jsp files that are only for view purpose and servlet classes deal with the
all database query.
Register.jsp save the details for new user by calling servlet class that is
AddNewUser.java.
uploadImg.jsp is also called uploadFileServlet.java class to save the details. This
class saves all the details into database.
Here are the some .jsp files which are directly deal with the database queries.
viewImageList.jsp directly contact with the database and accessing the details of
image list.
viewImage.jsp is also doing same thing.
viewAnItemBidUserDetails.jsp, userNotification.jsp, ownerDetails.jsp, login.jsp and
itemList.jsp, these jsp forms are also directly dealing with the database quiries
without calling and servlet class. Here is the java code is embedded in the .jsp files.
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide
1 out of 18
Related Documents
Your All-in-One AI-Powered Toolkit for Academic Success.
+13062052269
info@desklib.com
Available 24*7 on WhatsApp / Email
Unlock your academic potential
Copyright © 2020–2025 A2Z Services. All Rights Reserved. Developed and managed by ZUCOL.




