PPT Slide
db query Servlet: where’s the html file?
// doGet method is invoked when an html form is submitted with the GET
// method. ALSO, when there if no GET or POST method from your html file.
public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
// Start creating the HTML page
res.setContentType("text/html");
ServletOutputStream out = res.getOutputStream();
out.println("<HTML><HEAD><TITLE>IIT Project Inquiry</TITLE></HEAD>" +
"<BODY><FONT SIZE=+2>Project Inquiry<FONT SIZE=1><FONT SIZE=3>");
// Get the project number entered on the form
String squareSize = req.getParameter("SQUARE");
// If there is no projNumberParm, the servlet needs to build the
// HTML form that will prompt for a project number.
if (projNumberParm==" ") {
"<FORM METHOD=GET ACTION=\"/servlet/SimpleInq\">Project Number?" +
"<INPUT TYPE=TEXT NAME=proj SIZE=6<INPUT TYPE=SUBMIT NAME=action " +
"VALUE=\"Show Detail\"></FORM></BODY></HTML>");
else // if there is a projNumberParm, get the project data
{ loadProjData(projNumberParm, res, out); }
values = req.getParameterValues("proj");
String projNumberParm = " ";
projNumberParm = values[0];
Author | Title | Track | Home