Web Sheets UI Servlet Parameters SQL Statements Result
Web. Sheets UI Servlet Parameters SQL Statements Result. Set Figure 2. An input form page (Page 1) and a result page (Page 2) during development. Web. Dev allows a user to directly map input parameters to output table cells, as shown by the dotted arrow from the Min. Stock text of Page 1 to the reference in the Del. Select row of the table in Page 2. With servlet programming and approaches such as that of Ultra. Dev 4, the mapping is not so direct, as shown by the series of darkened arrows.
Web. Sheets Internal Architecture WYSIWYG specs Web. Dev Code Generator HTML template Figure 3. Code generation in Web. Dev Servlet including JDBC and DOM manipulation code XMLC Java DOM tree code
Sample Generated Servlet If(action. Tag. equals(“remove”)) { // Access request parameters String min. Stock = req. get. Parameter(“Min. Stock”); // Access DOM tree created from HTML templ Book. List. DOM doc = new Book. List. DOM(); // Execute specified delete operations using JDBC and // SQL Delete statements stmt. execute( "delete from BOOKS where INSTOCK<" + min. Stock); // Execute the specified Select statement to obtain a resultset. rs = stmt. execute. Query( "select BOOKS. ISBN, BOOKS. NAME, BOOKS. PRICE, BOOKS. INSTOCK from BOOKS where INSTOCK>10 and PRICE>22"); // Use DOM manipulation code to: while(rs. next()) { // Use DOM manipulation code to enter these values in the DOM tree. doc. set. Text_table 1_col 0(rs. get. String(1)); doc. set. Text_table 1_col 1(rs. get. String(2)); doc. set. Text_table 1_col 2(rs. get. String(3)); doc. set. Text_table 1_col 3(rs. get. String(4)); // Evaluate the spreadsheet formulas of the “expressions” doc. set. Text_table 1_col 4( String. value. Of(rs. get. Int(3) * rs. get. Int(4))); // Clone the sample row temp. Row. get. Parent. Node(). insert. Before( temp. Row. clone. Node(true), temp. Row); } // Remove the sample row temp. Row. get. Parent. Node(). remove. Child(temp. Row); // Write the updated DOM tree to the browser out. println(doc. to. Document()); } else if(action. Tag. equals(“add”)) { // … }
- Slides: 3