Bài Giảng Lập Trình JSP P2

Bài Giảng Lập Trình JSP _P1

Bài Giảng Lập Trình JSP _P1

... database • Efficiency issues – Prepared statements – Connection pooling web container control servlet JSP database database driver JDBC DBMS database server 11 User-friendly Error Handling • Tell user
Ngày tải lên : 14/07/2014, 16:00
  • 17
  • 232
  • 1
Bài Giảng Lập Trình JSP _P2

Bài Giảng Lập Trình JSP _P2

... Building a Web Application • Modify and add files to create web site index .jsp Prompts user for number of widgets reciept .jsp Displays number of widgets purchased Deploying your Site to Tomcat • Right-click ... site Structure shown in the project window Creates an initial index .jsp page (default home page of the new site) The index .jsp is initially just a “Hello world” page B...
Ngày tải lên : 14/07/2014, 16:00
  • 39
  • 209
  • 1
Bài Giảng Lập Trình JSP _P3

Bài Giảng Lập Trình JSP _P3

... library 22 Commenting JSP Files • Crucial to future maintenance of site • Inside of JSP code (between <% and %>): // comment /* comment */ • Outside of JSP code (that is, in html) <! comment > 8 JSP ... 10 JSP Scoping • Variable declared in a block of JSP on a page • May be accessed by any other JSP on same page • No access to variable from any ... code Data from...
Ngày tải lên : 14/07/2014, 16:00
  • 23
  • 329
  • 0
Bài Giảng Lập Trình JSP _P4

Bài Giảng Lập Trình JSP _P4

... selected …peripherals=camera&peripherals=scanner… • getParameter method will not work! 7 Example Result 9 Checkbox JSP • If execute JSP code: String monitor = request.getParameter("monitor"); monitor will have ... VALUE="Printer“/>Printer <OPTION VALUE="Scanner“/>Scanner </SELECT> 23 JSP for Multiple Selection Lists • String[] request.getParam...
Ngày tải lên : 14/07/2014, 16:00
  • 27
  • 235
  • 1
Bài Giảng Lập Trình JSP _P5

Bài Giảng Lập Trình JSP _P5

... etc.). – Decide which JSP should be sent back as response. – Forward control (and request data) to that JSP. request Control servlet JSP response JSPs act as views JSP JSP Servlet Details • Important ... JSP) – Methods invoked by a request for the servlet – Usually redirects to a JSP Tomcat Request for servlet Servlet Servlet methods called JSP Redirect to appropriate respo...
Ngày tải lên : 14/07/2014, 16:00
  • 26
  • 350
  • 0
Bài Giảng Lập Trình JSP _P6

Bài Giảng Lập Trình JSP _P6

... context.getInitParameter(“name"); • Accessing from a JSP: – String value = application.getInitParameter(“name"); Built-in object in JSP (like “request”) Context Parameters Form of xml tag Welcome ... Parameters Form of xml tag Welcome Page Properties • Page shown at webapp startup – Default: index .jsp • Can change to a new welcome file Configuration Files • Each webapp has a...
Ngày tải lên : 14/07/2014, 16:00
  • 18
  • 226
  • 1
Bài Giảng Lập Trình JSP _P7

Bài Giảng Lập Trình JSP _P7

... approach: Force JSP to repeat validation done in servlet to determine which messages to display • Better approach: Once servlet detects error, it creates error message and passes to JSP as attribute Servlet Detects ... type=“text” name=“fieldname” value= “<%= fieldValue %>” > Displaying Error Messages in JSP Calendar Dates in Java • Construct a new GregorianCalendar object...
Ngày tải lên : 14/07/2014, 16:00
  • 40
  • 235
  • 0
Bài Giảng Lập Trình JSP _P8

Bài Giảng Lập Trình JSP _P8

... other JSPs test whether attribute is null • If so, redirect to another page – Initial page in sequence – Error page telling session has expired • Syntax for redirection from JSP: < ;jsp: forward ... Data • Servlets/JSPs can store data associated with session ID • Servlets/JSPs can look up that data in future when passed the session ID in request Server session ID Client data Servlet or...
Ngày tải lên : 14/07/2014, 16:00
  • 24
  • 217
  • 1
Bài Giảng Lập Trình JSP _P9

Bài Giảng Lập Trình JSP _P9

... list Used together to loop through and show all Items on “shopping cart” page Getting Cost in JSP Order Class Business Model Objects Key idea: • Methods in model objects should implement business ... set/get quantity – Method to get total cost of order • Computed from quantity here instead of in JSP/ servlet – Method to check whether quantity valid in terms of business model • Servlet...
Ngày tải lên : 14/07/2014, 16:00
  • 41
  • 224
  • 0