SlideShare a Scribd company logo
1 of 9
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 Detailsi-love-flamingo
 
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 appficadaCaelum
 
Master UX from design to prototype
Master UX from design to prototypeMaster UX from design to prototype
Master UX from design to prototypeSalvatore 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 2Dipendra Shekhawat
 
Once Source to Rule Them All
Once Source to Rule Them AllOnce Source to Rule Them All
Once Source to Rule Them AllDavid 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 PronkoMax Pronko
 
Documentation For Tab Setup
Documentation For Tab SetupDocumentation For Tab Setup
Documentation For Tab Setupvkeeton
 
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-phpapp01Jason 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 8netmind
 
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.clubMagento 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

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

SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 

Recently uploaded (20)

Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 

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):