Handling the Accumulated “State”
The page returned by the VendingMachine servlet contains a final form generated by:
out.println(“<form action=” + viewURL + “>”) ;
out.println(“View current selections:
printHidden(out, selections) ;
Here viewURL is a reference to a second servlet, which generates a page containing the contents of the hidden fields.