O'Reilly logo

XML and Java™ from scratch by Nicholas Chase

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Accepting Payment Information

At this point, we have a page that shows the user his or her order and allows the input of payment information. All that's left is for us to create a servlet to take in that information, and Listing 6.40 is that servlet.

Listing 6.40. CompleteOrder.java: Saving Payment Information
 0: import java.io.*; 1: import javax.servlet.*; 2: import javax.servlet.http.*; 3: import org.apache.xerces.parsers.DOMParser; 4: import org.w3c.dom.Document; 4a:import org.w3c.dom.Node; 4b:import org.w3c.dom.NamedNodeMap; 4c:import org.w3c.dom.NodeList; 5: import org.apache.xml.serialize.XMLSerializer; 6: import org.apache.xml.serialize.OutputFormat; 7: 8:public class CompleteOrder extends HttpServlet { 9: 10: //********* BEGIN doGet() ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required