Create following Shopping site with only Servlets.
1. Your site should start from servlet which does following:
(3) Your site only works for IE (check word "Trident" for IE or not). If not, show error page using HTML standard error code "HttpServletResponse.SC_HTTP_VERSION_NOT_SUPPORTED" and your message "Only Microsoft IE browser is working for this site."
(7) Check if user is first time visitor by checking the cookie "Visit" yer or no. if new visitor, set " Visit " cookie with yes for one year and move user to servlet.
(5) The header of should say "Welcome New Visitor" when if user is new visitor. Otherwise, just "Welcome Back".

2. (10) From, does following: This page has one shopping item text box that user can type any item but blank with "Add to Shopping List" button to add to shopping list (
If user types blank and submit "Add" button, system should show same page with error message "Please enter shopping item." next to the shopping item text box.

3. (10) From, it just shows all shopping list you added so far in list format. And, at the end, you have a link to go back "Keep Shopping" to All shopping items must be stored in a session value. So, whenever you add new item from page, your list keeps previous items in list and just add new one.
Shopping list.html
<TITLE>Shopping List</TITLE>
<H1>Shopping List</H1>
<LI>List 1</LI>
<LI>List 2</LI>
<LI>List 3</LI>
<br><a href="StartMyShopping">Keep Shopping >></a><br><br>
<TITLE>Order Form</TITLE>
<H1>Welcome Back</H1>
<FORM ACTION="shoppingList" METHOD="POST">
<TD>Shopping Item:</TD>
<TD><INPUT TYPE="TEXT" NAME="Item" maxlength="20" size="25">
<br><BUTTON TYPE="SUBMIT" NAME="AddBtn" VALUE="AddBtn" size=80>Add to Shopping List</BUTTON>

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

package servlet;

import java.util.ArrayList;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

* Servlet implementation class ShoppingList
public class ShoppingList extends HttpServlet {
private static final long serialVersionUID = 1L;

private ArrayList<String> lstItems;
    * @see HttpServlet#HttpServlet()
    public ShoppingList() {
       // TODO Auto-generated constructor stub
       lstItems = new ArrayList<String>();

* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
String error = (String) request.getAttribute("error");
if(error != null && !error.trim().equals("")) {
RequestDispatcher dispather = request.getRequestDispatcher("StartMyShopping");
} else {
String item = (String) request.getAttribute("item");


String lst = "<HTML>\n" +
"\n" +
"<HEAD>\n" +
"\n" +
"<TITLE>Shopping List</TITLE>\n" +
"\n" +
"</HEAD>\n" +
"\n" +
"<BODY>\n" +
"\n" +
"<CENTER>\n" +
"\n" +
"<H1>Shopping List</H1>\n" +
"\n" +
"<UL>\n" +

for (String itm: lstItems...

By purchasing this solution you'll be able to access the following files:

50% discount

$50.00 $25.00
for this solution

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Web Development (HTML, XML, PHP, JavaScript, Adobe, Flash, etc.) Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Upload a file
Continue without uploading

We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats