SlideShare a Scribd company logo
Page No: 1
Report on Open Ended Problem (OEP)
(Academic Year: 2016-2017)
Subject Code: 2160707
Subject Name:Advanced Java
Definition of OEP:
Create a shopping cart application using JSP technology to display all the items added in the cart.
Design the following pages: a. Home page containing the gallery of items in the form of thumbnails.
Below each thumbnail display the price and item code for that item. Also there must be a checkbox
displaying the text add to cart below the pries of each item. User can click on multiple checkboxes to
add items in his cart. At the bottom of the page there must be a submit button which when clicked, control
must be redirected to another page. b. Display page must add the entire selected item’s code and its price
in cookie and read those values from cookie to display those items that are selected from the previous
page. Also display the details of each item (i.e. item code and price) in a tabular form.
Submitted By:
1. Shah Maunil (140120107149)
2. Shah Naiya (140120107150)
3. Shah Prakshal (140120107151)
4. Shah Radha (140120107152)
5. Shah Ronak (140120107153)
Group_Id:CE_AJAVA_OEP_31
Branch: Computer Department
Division & Batch: 6th CE-C, C1
Guided By
Name of Faculty: Prof. MukeshParmar
Department: Computer Department
Page No: 2
INDEX
Sr No Title Page No
1 Definition 3
2 Implementation Code 3
3 Screenshot of Implementation 8
Page No: 3
1. Definition:
Although there are many uses for the session object, one of the most common uses
is to store items for online shopping. When you shop online, you usually browse around the Web
site, occasionally clicking an "Add to Shopping Cart" button to signal that you want to buy
something. When you are done, you click "Check Out" and fill out your billing information. The
session object is a logical place to keep shopping cart data. You can, of course, keep the data
on the client's browser, but it can get pretty cumbersome trying to keep up with the shopping cart
on the client when the user goes from page to page. You can also store the shopping cart in a
database and just keep enough data in the session to make it possible to retrieve the shopping cart
out of the database. If the database is fast enough and you have so many sessions active at one
time that you can't keep all the data in memory, the database might be a better solution. For most
applications, however, the session is the ideal place.
2. Implementation Code(Input Code):
a. Home page containing the gallery of items in the form of thumbnails. Below each
thumbnail display the price and item code for that item. Also there must be a checkbox
displaying the text add to cart below the pries of each item. User can click on multiple
checkboxes to add items in his cart. At the bottom of the page there must be a submit
button which when clicked, control must be redirected to another page
ModelList.jsp:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>www.tech-freaks.in - Model List</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<p><font size="3" face="Verdana, Arial, Helvetica, sans-serif"><strong>Model
List</strong></font></p>
<a href="/ShoppingCart.jsp" mce_href="ShoppingCart.jsp">View Cart</a>
<p/>
<table width="75%" border="1">
<tr>
<td><formname="modelDetail1"method="POST"action="servlet/CartControll">
<font size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Model:</strong>
Page No: 4
TF-Model1</font><input type="hidden" name="modelNo" value="TF-MODEL1">
<p><font size="2" face="Verdana, Arial, Helvetica, sans-
serif"><strong>Description:</strong>
Tech-Freaks imaginary model 1. </font><input type="hidden" name="description"
value="Tech-Freaks imaginary model 1."></p>
<p><font size="2" face="Verdana, Arial, Helvetica, sans-
serif"><strong>Quantity:<input type="text" size="2" value="1"
name="quantity"></strong></font></p>
<p><font size="2" face="Verdana, Arial, Helvetica, sans-
serif"><strong>Price:</strong>
$10.00</font><input type="hidden" name="price" value="10"></p><input
type="hidden" name="action" value="add"><input type="submit" name="addToCart"
value="Add To Cart">
</form></td>
<td><form name="modelDetail2" method="POST"
action="servlet/CartController"><font size="2" face="Verdana, Arial, Helvetica, sans-
serif"><strong>Model</strong>:
TF-Model2 </font><input type="hidden" name="modelNo" value="TF-MODEL2">
<font face="Verdana, Arial, Helvetica, sans-serif">
<p><font size="2"><strong>Description</strong>: Tech-Freaks imaginary model
2. </font><input type="hidden" name="description" value="Tech-Freaks imaginary
model 2."></p>
<p><font size="2"><strong>Quantity</strong>: <input type="text" size="2"
value="1" name="quantity"></font></p>
<p><font size="2"><strong>Price</strong>: $20.00<input type="hidden"
name="price" value="20"></font></p>
<input type="hidden" name="action" value="add">
<input type="submit" name="addToCart" value="Add To Cart">
</font></form></td>
</tr>
<tr>
<td><form name="modelDetail3" method="POST"
action="servlet/CartController"><p><font size="2" face="Verdana, Arial, Helvetica,
sans-serif"><strong>Model:</strong>
TF-Model3</font><input type="hidden" name="modelNo" value="TF-
MODEL3"></p>
<p><font size="2" face="Verdana, Arial, Helvetica, sans-
serif"><strong>Description:</strong>
Tech-Freaks imaginary model 3. </font><input type="hidden" name="description"
value="Tech-Freaks imaginary model 3."></p>
<p><font size="2" face="Verdana, Arial, Helvetica, sans-
serif"><strong>Quantity:</strong></font> <input type="text" size="2" value="1"
name="quantity"></p>
<p><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Price:
$30.00</strong></font><input type="hidden" name="price" value="30"></p> <input
type="hidden" name="action" value="add">
Page No: 5
<input type="submit" name="addToCart" value="Add To Cart">
</form></td>
<td><form name="modelDetail4" method="POST"
action="servlet/CartController"><p><font size="2" face="Verdana, Arial, Helvetica,
sans-serif"><strong>Model</strong>:
TF-Model4</font><input type="hidden" name="modelNo" value="TF-
MODEL4"></p>
<p><font size="2" face="Verdana, Arial, Helvetica, sans-
serif"><strong>Description</strong>:
Tech-Freaks imaginary model 4. </font><input type="hidden" name="description"
value="Tech-Freaks imaginary model 4."></p>
<p><font size="2" face="Verdana, Arial, Helvetica, sans-
serif"><strong>Quantity</strong>:</font> <input type="text" size="2" value="1"
name="quantity"></p>
<p><font size="2" face="Verdana, Arial, Helvetica, sans-
serif"><strong>Price</strong>: $40.00</font><input type="hidden" name="price"
value="40"></p>
<input type="hidden" name="action" value="add"><input type="submit"
name="addToCart" value="Add To Cart"></form></td>
</tr>
</table>
<p> </p>
</body>
</html>
b. Display page must add the entire selected item’s code and its price in cookie and read
those values from cookie to display those items that are selected from the previous
page. Also display the details of each item (i.e. item code and price) in a tabular form.
ShoppingCart.jsp
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>www.tech-freaks.in - Shopping Cart</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<p><font face="Verdana, Arial, Helvetica, sans-serif"><strong>Shopping
Cart</strong></font></p>
<p><a href="/ModelList.jsp" mce_href="ModelList.jsp">Model List</a> </p>
<table width="75%" border="1">
Page No: 6
<tr bgcolor="#CCCCCC">
<td><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Model
Description</font></strong></td>
<td><strong><font size="2" face="Verdana, Arial, Helvetica, sans-
serif">Quantity</font></strong></td>
<td><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Unit
Price</font></strong></td>
<td><strong><font size="2" face="Verdana, Arial, Helvetica, sans-
serif">Total</font></strong></td>
</tr>
<jsp:useBean id="cart" scope="session"
class="in.techfreaks.shoppingcart.beans.CartBean" />
<c:if test="${cart.lineItemCount==0}">
<tr>
<td colspan="4"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">- Cart is
currently empty -<br/>
</tr>
</c:if>
<c:forEach var="cartItem" items="${cart.cartItems}" varStatus="counter">
<form name="item" method="POST" action="servlet/CartController">
<tr>
<td><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><b><c:out
value="${cartItem.partNumber}"/></b><br/>
<c:out value="${cartItem.modelDescription}"/></font></td>
<td><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><input
type='hidden' name='itemIndex' value='<c:out value="${counter.count}"/>'><input
type='text' name="quantity" value='<c:out value="${cartItem.quantity}"/>' size='2'>
<input type="submit" name="action" value="Update">
<br/> <input type="submit" name="action" value="Delete"></font></td>
<td><font size="2" face="Verdana, Arial, Helvetica, sans-serif">$<c:out
value="${cartItem.unitCost}"/></font></td>
<td><font size="2" face="Verdana, Arial, Helvetica, sans-serif">$<c:out
value="${cartItem.totalCost}"/></font></td>
</tr>
</form>
</c:forEach>
<tr>
<td colspan="2"> </td>
<td> </td>
<td><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Subtotal: $<c:out
value="${cart.orderTotal}"/></font></td>
</tr>
</table>
</body>
</html>
Page No: 7
package examples;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
public class DumpCookiesServlet extends HttpServlet
{
public void service(HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException
{
Cookie[] cookies = request.getCookies();
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<html><body bgcolor="#ffffff">");
out.println("Your browser sent the following cookies:");
out.println("<pre>");
if (cookies != null)
{
for (int i=0; i < cookies.length; i++)
{
out.println(cookies[i].getName()+": "+cookies[i].getValue());
}
}
out.println("</pre>");
out.println("</body></html>");
}
Page No: 8
3. ScreenShotof Implementation(Output):
Page No: 9

More Related Content

Similar to Ajava oep

Flamingo Commerce Module Details
Flamingo Commerce Module DetailsFlamingo Commerce Module Details
Flamingo Commerce Module Details
i-love-flamingo
 
Managing states
Managing statesManaging states
Managing states
Paneliya Prince
 
Progressive Web Apps: o melhor da Web appficada
Progressive Web Apps: o melhor da Web appficadaProgressive Web Apps: o melhor da Web appficada
Progressive Web Apps: o melhor da Web appficada
Caelum
 
Master UX from design to prototype
Master UX from design to prototypeMaster UX from design to prototype
Master UX from design to prototype
Salvatore Iaconesi
 
Online Store Modules
Online Store ModulesOnline Store Modules
Online Store ModulesKavita Sharma
 
Creating web api and consuming part 2
Creating web api and consuming part 2Creating web api and consuming part 2
Creating web api and consuming part 2
Dipendra Shekhawat
 
Once Source to Rule Them All
Once Source to Rule Them AllOnce Source to Rule Them All
Once Source to Rule Them All
David Yeiser
 
Checkout in Magento 2 by Max Pronko
Checkout in Magento 2 by Max PronkoCheckout in Magento 2 by Max Pronko
Checkout in Magento 2 by Max Pronko
Max Pronko
 
Documentation For Tab Setup
Documentation For Tab SetupDocumentation For Tab Setup
Documentation For Tab Setup
vkeeton
 
Website Update Proposal, Version 1.1
Website Update Proposal, Version 1.1Website Update Proposal, Version 1.1
Website Update Proposal, Version 1.1coffeetableplace
 
Al majed 4 oud - An inspirational Digital Transformation Story of D2C E-comme...
Al majed 4 oud - An inspirational Digital Transformation Story of D2C E-comme...Al majed 4 oud - An inspirational Digital Transformation Story of D2C E-comme...
Al majed 4 oud - An inspirational Digital Transformation Story of D2C E-comme...
Gaurav Chaudhary
 
Technology Survey and Design
Technology Survey and DesignTechnology Survey and Design
Technology Survey and DesignMilind Gokhale
 
Create a mobile web app with Sencha Touch
Create a mobile web app with Sencha TouchCreate a mobile web app with Sencha Touch
Create a mobile web app with Sencha TouchJames Pearce
 
Cart creation-101217222728-phpapp01
Cart creation-101217222728-phpapp01Cart creation-101217222728-phpapp01
Cart creation-101217222728-phpapp01
Jason Noble
 
jQuery Mobile
jQuery MobilejQuery Mobile
jQuery Mobilemowd8574
 
netmind - Primer Contacto con el Desarrollo de Aplicaciones para Windows 8
netmind - Primer Contacto con el Desarrollo de Aplicaciones para Windows 8netmind - Primer Contacto con el Desarrollo de Aplicaciones para Windows 8
netmind - Primer Contacto con el Desarrollo de Aplicaciones para Windows 8
netmind
 
Magento ajax search autocomplete and suggest mage.club
Magento ajax search autocomplete and suggest mage.clubMagento ajax search autocomplete and suggest mage.club
Magento ajax search autocomplete and suggest mage.club
Magento Club
 

Similar to Ajava oep (20)

Flamingo Commerce Module Details
Flamingo Commerce Module DetailsFlamingo Commerce Module Details
Flamingo Commerce Module Details
 
Managing states
Managing statesManaging states
Managing states
 
Documento
DocumentoDocumento
Documento
 
Progressive Web Apps: o melhor da Web appficada
Progressive Web Apps: o melhor da Web appficadaProgressive Web Apps: o melhor da Web appficada
Progressive Web Apps: o melhor da Web appficada
 
Master UX from design to prototype
Master UX from design to prototypeMaster UX from design to prototype
Master UX from design to prototype
 
Online Store Modules
Online Store ModulesOnline Store Modules
Online Store Modules
 
Creating web api and consuming part 2
Creating web api and consuming part 2Creating web api and consuming part 2
Creating web api and consuming part 2
 
Once Source to Rule Them All
Once Source to Rule Them AllOnce Source to Rule Them All
Once Source to Rule Them All
 
Checkout in Magento 2 by Max Pronko
Checkout in Magento 2 by Max PronkoCheckout in Magento 2 by Max Pronko
Checkout in Magento 2 by Max Pronko
 
Documentation For Tab Setup
Documentation For Tab SetupDocumentation For Tab Setup
Documentation For Tab Setup
 
Website Update Proposal, Version 1.1
Website Update Proposal, Version 1.1Website Update Proposal, Version 1.1
Website Update Proposal, Version 1.1
 
Al majed 4 oud - An inspirational Digital Transformation Story of D2C E-comme...
Al majed 4 oud - An inspirational Digital Transformation Story of D2C E-comme...Al majed 4 oud - An inspirational Digital Transformation Story of D2C E-comme...
Al majed 4 oud - An inspirational Digital Transformation Story of D2C E-comme...
 
Technology Survey and Design
Technology Survey and DesignTechnology Survey and Design
Technology Survey and Design
 
Create a mobile web app with Sencha Touch
Create a mobile web app with Sencha TouchCreate a mobile web app with Sencha Touch
Create a mobile web app with Sencha Touch
 
Cart creation-101217222728-phpapp01
Cart creation-101217222728-phpapp01Cart creation-101217222728-phpapp01
Cart creation-101217222728-phpapp01
 
jQuery Mobile
jQuery MobilejQuery Mobile
jQuery Mobile
 
netmind - Primer Contacto con el Desarrollo de Aplicaciones para Windows 8
netmind - Primer Contacto con el Desarrollo de Aplicaciones para Windows 8netmind - Primer Contacto con el Desarrollo de Aplicaciones para Windows 8
netmind - Primer Contacto con el Desarrollo de Aplicaciones para Windows 8
 
Magento ajax search autocomplete and suggest mage.club
Magento ajax search autocomplete and suggest mage.clubMagento ajax search autocomplete and suggest mage.club
Magento ajax search autocomplete and suggest mage.club
 
lect4
lect4lect4
lect4
 
lect4
lect4lect4
lect4
 

More from Paneliya Prince

140120107044 ins ala.ppt
140120107044 ins ala.ppt140120107044 ins ala.ppt
140120107044 ins ala.ppt
Paneliya Prince
 
To create a web service
To create a web serviceTo create a web service
To create a web service
Paneliya Prince
 
Session and state management
Session and state managementSession and state management
Session and state management
Paneliya Prince
 
Introduction to ado.net
Introduction to ado.netIntroduction to ado.net
Introduction to ado.net
Paneliya Prince
 
Grid view control
Grid view controlGrid view control
Grid view control
Paneliya Prince
 
Asp.net validation
Asp.net validationAsp.net validation
Asp.net validation
Paneliya Prince
 
Asp.net control
Asp.net controlAsp.net control
Asp.net control
Paneliya Prince
 
Wt oep visiting card
Wt oep visiting cardWt oep visiting card
Wt oep visiting card
Paneliya Prince
 
SE OEP online car service booking
SE OEP online car service bookingSE OEP online car service booking
SE OEP online car service booking
Paneliya Prince
 
creating jdbc connection
creating jdbc connectioncreating jdbc connection
creating jdbc connection
Paneliya Prince
 
processing control input
processing control inputprocessing control input
processing control input
Paneliya Prince
 
static dictionary technique
static dictionary techniquestatic dictionary technique
static dictionary technique
Paneliya Prince
 
creating jdbc connection
creating jdbc connectioncreating jdbc connection
creating jdbc connection
Paneliya Prince
 
static dictionary
static dictionarystatic dictionary
static dictionary
Paneliya Prince
 
ADO.net control
ADO.net controlADO.net control
ADO.net control
Paneliya Prince
 
web technology
 web technology web technology
web technology
Paneliya Prince
 
browse architecture and website structure
browse architecture and website structurebrowse architecture and website structure
browse architecture and website structure
Paneliya Prince
 

More from Paneliya Prince (20)

140120107044 ins ala.ppt
140120107044 ins ala.ppt140120107044 ins ala.ppt
140120107044 ins ala.ppt
 
To create a web service
To create a web serviceTo create a web service
To create a web service
 
Session and state management
Session and state managementSession and state management
Session and state management
 
Master pages
Master pagesMaster pages
Master pages
 
Master page
Master pageMaster page
Master page
 
Introduction to ado.net
Introduction to ado.netIntroduction to ado.net
Introduction to ado.net
 
Grid view control
Grid view controlGrid view control
Grid view control
 
Asp.net validation
Asp.net validationAsp.net validation
Asp.net validation
 
Asp.net control
Asp.net controlAsp.net control
Asp.net control
 
Wt oep visiting card
Wt oep visiting cardWt oep visiting card
Wt oep visiting card
 
SE OEP online car service booking
SE OEP online car service bookingSE OEP online car service booking
SE OEP online car service booking
 
creating jdbc connection
creating jdbc connectioncreating jdbc connection
creating jdbc connection
 
processing control input
processing control inputprocessing control input
processing control input
 
static dictionary technique
static dictionary techniquestatic dictionary technique
static dictionary technique
 
creating jdbc connection
creating jdbc connectioncreating jdbc connection
creating jdbc connection
 
DCDR
DCDRDCDR
DCDR
 
static dictionary
static dictionarystatic dictionary
static dictionary
 
ADO.net control
ADO.net controlADO.net control
ADO.net control
 
web technology
 web technology web technology
web technology
 
browse architecture and website structure
browse architecture and website structurebrowse architecture and website structure
browse architecture and website structure
 

Recently uploaded

Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
TeeVichai
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
ViniHema
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Dr.Costas Sachpazis
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
zwunae
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
manasideore6
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
Jayaprasanna4
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
seandesed
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
SupreethSP4
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
Pratik Pawar
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
AhmedHussein950959
 

Recently uploaded (20)

Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
 

Ajava oep

  • 1. Page No: 1 Report on Open Ended Problem (OEP) (Academic Year: 2016-2017) Subject Code: 2160707 Subject Name:Advanced Java Definition of OEP: Create a shopping cart application using JSP technology to display all the items added in the cart. Design the following pages: a. Home page containing the gallery of items in the form of thumbnails. Below each thumbnail display the price and item code for that item. Also there must be a checkbox displaying the text add to cart below the pries of each item. User can click on multiple checkboxes to add items in his cart. At the bottom of the page there must be a submit button which when clicked, control must be redirected to another page. b. Display page must add the entire selected item’s code and its price in cookie and read those values from cookie to display those items that are selected from the previous page. Also display the details of each item (i.e. item code and price) in a tabular form. Submitted By: 1. Shah Maunil (140120107149) 2. Shah Naiya (140120107150) 3. Shah Prakshal (140120107151) 4. Shah Radha (140120107152) 5. Shah Ronak (140120107153) Group_Id:CE_AJAVA_OEP_31 Branch: Computer Department Division & Batch: 6th CE-C, C1 Guided By Name of Faculty: Prof. MukeshParmar Department: Computer Department
  • 2. Page No: 2 INDEX Sr No Title Page No 1 Definition 3 2 Implementation Code 3 3 Screenshot of Implementation 8
  • 3. Page No: 3 1. Definition: Although there are many uses for the session object, one of the most common uses is to store items for online shopping. When you shop online, you usually browse around the Web site, occasionally clicking an "Add to Shopping Cart" button to signal that you want to buy something. When you are done, you click "Check Out" and fill out your billing information. The session object is a logical place to keep shopping cart data. You can, of course, keep the data on the client's browser, but it can get pretty cumbersome trying to keep up with the shopping cart on the client when the user goes from page to page. You can also store the shopping cart in a database and just keep enough data in the session to make it possible to retrieve the shopping cart out of the database. If the database is fast enough and you have so many sessions active at one time that you can't keep all the data in memory, the database might be a better solution. For most applications, however, the session is the ideal place. 2. Implementation Code(Input Code): a. Home page containing the gallery of items in the form of thumbnails. Below each thumbnail display the price and item code for that item. Also there must be a checkbox displaying the text add to cart below the pries of each item. User can click on multiple checkboxes to add items in his cart. At the bottom of the page there must be a submit button which when clicked, control must be redirected to another page ModelList.jsp: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>www.tech-freaks.in - Model List</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <p><font size="3" face="Verdana, Arial, Helvetica, sans-serif"><strong>Model List</strong></font></p> <a href="/ShoppingCart.jsp" mce_href="ShoppingCart.jsp">View Cart</a> <p/> <table width="75%" border="1"> <tr> <td><formname="modelDetail1"method="POST"action="servlet/CartControll"> <font size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Model:</strong>
  • 4. Page No: 4 TF-Model1</font><input type="hidden" name="modelNo" value="TF-MODEL1"> <p><font size="2" face="Verdana, Arial, Helvetica, sans- serif"><strong>Description:</strong> Tech-Freaks imaginary model 1. </font><input type="hidden" name="description" value="Tech-Freaks imaginary model 1."></p> <p><font size="2" face="Verdana, Arial, Helvetica, sans- serif"><strong>Quantity:<input type="text" size="2" value="1" name="quantity"></strong></font></p> <p><font size="2" face="Verdana, Arial, Helvetica, sans- serif"><strong>Price:</strong> $10.00</font><input type="hidden" name="price" value="10"></p><input type="hidden" name="action" value="add"><input type="submit" name="addToCart" value="Add To Cart"> </form></td> <td><form name="modelDetail2" method="POST" action="servlet/CartController"><font size="2" face="Verdana, Arial, Helvetica, sans- serif"><strong>Model</strong>: TF-Model2 </font><input type="hidden" name="modelNo" value="TF-MODEL2"> <font face="Verdana, Arial, Helvetica, sans-serif"> <p><font size="2"><strong>Description</strong>: Tech-Freaks imaginary model 2. </font><input type="hidden" name="description" value="Tech-Freaks imaginary model 2."></p> <p><font size="2"><strong>Quantity</strong>: <input type="text" size="2" value="1" name="quantity"></font></p> <p><font size="2"><strong>Price</strong>: $20.00<input type="hidden" name="price" value="20"></font></p> <input type="hidden" name="action" value="add"> <input type="submit" name="addToCart" value="Add To Cart"> </font></form></td> </tr> <tr> <td><form name="modelDetail3" method="POST" action="servlet/CartController"><p><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Model:</strong> TF-Model3</font><input type="hidden" name="modelNo" value="TF- MODEL3"></p> <p><font size="2" face="Verdana, Arial, Helvetica, sans- serif"><strong>Description:</strong> Tech-Freaks imaginary model 3. </font><input type="hidden" name="description" value="Tech-Freaks imaginary model 3."></p> <p><font size="2" face="Verdana, Arial, Helvetica, sans- serif"><strong>Quantity:</strong></font> <input type="text" size="2" value="1" name="quantity"></p> <p><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Price: $30.00</strong></font><input type="hidden" name="price" value="30"></p> <input type="hidden" name="action" value="add">
  • 5. Page No: 5 <input type="submit" name="addToCart" value="Add To Cart"> </form></td> <td><form name="modelDetail4" method="POST" action="servlet/CartController"><p><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Model</strong>: TF-Model4</font><input type="hidden" name="modelNo" value="TF- MODEL4"></p> <p><font size="2" face="Verdana, Arial, Helvetica, sans- serif"><strong>Description</strong>: Tech-Freaks imaginary model 4. </font><input type="hidden" name="description" value="Tech-Freaks imaginary model 4."></p> <p><font size="2" face="Verdana, Arial, Helvetica, sans- serif"><strong>Quantity</strong>:</font> <input type="text" size="2" value="1" name="quantity"></p> <p><font size="2" face="Verdana, Arial, Helvetica, sans- serif"><strong>Price</strong>: $40.00</font><input type="hidden" name="price" value="40"></p> <input type="hidden" name="action" value="add"><input type="submit" name="addToCart" value="Add To Cart"></form></td> </tr> </table> <p> </p> </body> </html> b. Display page must add the entire selected item’s code and its price in cookie and read those values from cookie to display those items that are selected from the previous page. Also display the details of each item (i.e. item code and price) in a tabular form. ShoppingCart.jsp <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>www.tech-freaks.in - Shopping Cart</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <p><font face="Verdana, Arial, Helvetica, sans-serif"><strong>Shopping Cart</strong></font></p> <p><a href="/ModelList.jsp" mce_href="ModelList.jsp">Model List</a> </p> <table width="75%" border="1">
  • 6. Page No: 6 <tr bgcolor="#CCCCCC"> <td><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Model Description</font></strong></td> <td><strong><font size="2" face="Verdana, Arial, Helvetica, sans- serif">Quantity</font></strong></td> <td><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Unit Price</font></strong></td> <td><strong><font size="2" face="Verdana, Arial, Helvetica, sans- serif">Total</font></strong></td> </tr> <jsp:useBean id="cart" scope="session" class="in.techfreaks.shoppingcart.beans.CartBean" /> <c:if test="${cart.lineItemCount==0}"> <tr> <td colspan="4"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">- Cart is currently empty -<br/> </tr> </c:if> <c:forEach var="cartItem" items="${cart.cartItems}" varStatus="counter"> <form name="item" method="POST" action="servlet/CartController"> <tr> <td><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><b><c:out value="${cartItem.partNumber}"/></b><br/> <c:out value="${cartItem.modelDescription}"/></font></td> <td><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><input type='hidden' name='itemIndex' value='<c:out value="${counter.count}"/>'><input type='text' name="quantity" value='<c:out value="${cartItem.quantity}"/>' size='2'> <input type="submit" name="action" value="Update"> <br/> <input type="submit" name="action" value="Delete"></font></td> <td><font size="2" face="Verdana, Arial, Helvetica, sans-serif">$<c:out value="${cartItem.unitCost}"/></font></td> <td><font size="2" face="Verdana, Arial, Helvetica, sans-serif">$<c:out value="${cartItem.totalCost}"/></font></td> </tr> </form> </c:forEach> <tr> <td colspan="2"> </td> <td> </td> <td><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Subtotal: $<c:out value="${cart.orderTotal}"/></font></td> </tr> </table> </body> </html>
  • 7. Page No: 7 package examples; import javax.servlet.*; import javax.servlet.http.*; import java.io.*; public class DumpCookiesServlet extends HttpServlet { public void service(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { Cookie[] cookies = request.getCookies(); response.setContentType("text/html"); PrintWriter out = response.getWriter(); out.println("<html><body bgcolor="#ffffff">"); out.println("Your browser sent the following cookies:"); out.println("<pre>"); if (cookies != null) { for (int i=0; i < cookies.length; i++) { out.println(cookies[i].getName()+": "+cookies[i].getValue()); } } out.println("</pre>"); out.println("</body></html>"); }
  • 8. Page No: 8 3. ScreenShotof Implementation(Output):