CHAPTER 4 ■ SERVLET CONTAINER AND FRAMEWORKS closeDate = (("closeDate")); } catch( pe) { ("Exception " + pe); } // create the new opportunity Opportunity opp = new Opportunity( ("name"), new Double(("amount")).doubleValue(), ("stageName"), new Integer(("probability")).intValue(), closeDate, new Integer(("orderNumber")).intValue(), new Long(("accountId")) ); // persist the entity try { (opp); } finally { (); } ("telesales?action=accountDisplay&accountId="+request. getParameter("accountId")); } } public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doGet(request, response); } } 68 CHAPTER 4 ■ SERVLET CONTAINER AND FRAMEWORKS ■ Note The servlet in Listing 4-8 describes code for. | CHAPTER 4 SERVLET CONTAINER AND FRAMEWORKS closeDate closeDate catch pe Exception pe create the new opportunity Opportunity opp new Opportunity name new Double amount .doubleValue stageName new Integer probability .intValue closeDate new Integer orderNumber .intValue new Long accountId persist the entity try opp finally telesales action accountDisplay accountId request. getParameter accountId public void doPost HttpServletRequest request HttpServletResponse response throws ServletException lOException doGet request response 68 CHAPTER 4 SERVLET CONTAINER AND FRAMEWORKS Note The servlet in Listing 4-8 describes code for interacting with Bigtable. We ll provide more details on the PersistenceManager JDO and JDOQL in Chapter 7. Deployment Descriptor When the web server receives a request for your application it uses the deployment descriptor to map the URL of the request to the code handling the request. Modify the file with the code in Listing 4-9 to use the TelesalesServlet class. The servlet mapping specifies that all incoming requests to telesales be mapped to the newly created servlet defined in the servlet definition. Listing 4-9. The file xml version encoding utf-8 DOCTYPE web-app PUBLIC - Sun Microsystems Inc. DTD Web Application EN http dtd web-app xmlns http xml ns javaee version servlet servlet-name telesales servlet-name servlet-class servlet-class servlet servlet-mapping servlet-name telesales servlet-name url-pattern telesales url-pattern servlet-mapping welcome-file-list welcome-file welcome-file welcome-file-list web-app PersistenceManager The servlet utilizes Bigtable to store data for your .