Help me to complete this java


Recommended Posts

<%@page import="java.util.*" %>

<html>

<head>

<meta http-equiv="Content-Language" content="en-us">

<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">

<meta name="GENERATOR" content="Microsoft FrontPage 5.0">

<meta name="ProgId" content="FrontPage.Editor.Document">

<title>Order Form</title>

</head>

<body>

<h3>Please Complete the following order</h3>

<form method="GET" action="orderform1.jsp">

<% ArrayList previousitems =(ArrayList)session.getAttribute("previousitems");

if(previousitems==null)

previousitems =new ArrayList(10);

session.setAttribute("previousitems",previousitems);

String newitems=request.getParameter("title");

synchronized(previousitems){

if ((newitems!=null)&&(!newitems.trim().equals(""))){

previousitems.add(newitems);

}

if (previousitems.size()==0){

out.println("<I>No items</I>");

}

else{

or(int i=0;i<previousitems.size();i++){%>

<p> <input type="checkbox" name="check" value="add">

<%=(String)previousitems.get(i) %></p>

<%}

out.println("</UL>");

}%>

<p> New Items

<input type="text" name="title" size="6">

</p>

<p><input type="submit" name="submit" value="showorder">   

</form>

<form method="GET" action="orderform1.jsp">

<% String del =request.getParameter("title");

synchronized(previousitems){

if (previousitems.contains("del")){

(String)previousitems.remove(1);

}

for(int i=0;i<previousitems.size();i++){%>

<p><input type="checkbox" name="check" value="add">

<%=(String)previousitems.get(i) %></p>

<%}

} }%>

<input type="submit" name="submit" value="Remove">

</p>

</form>

</body>

</html>

Thank

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.