%@ page import="java.util.*" %> <%! String [] snacks = {"Chips", "Popcorn", "Peanuts", "Snickers bar", "Twix", "Pop Tarts", "Chocolate Donut"} ; %> <% Vector selections = (Vector) session.getAttribute("selections") ; if(selections == null) { selections = new Vector() ; session.setAttribute("selections", selections) ; } String selection = request.getParameter("selection") ; if(selection != null) selections.addElement(selection) ; %>
<% for(int i = 0 ; i < snacks.length ; i++) { %> <% } %> View current selections