1 JavaServer Pages 2 Nội dung Giới thiệu JSP Các script JSP Các directive Chèn File JavaBeans và JSP Custom JSP tag Kết hợp servlets,JSP 3 Ví dụ <BODY> <H2>JSP Expressions</H2> <UL> <LI>Current time: <%= new java.util.Date() %> <LI>Your hostname: <%= request.getRemoteHost() %> <LI>Your session ID: <%= session.getId() %> <LI>The <CODE>testParam</CODE> form parameter: <%= request.getParameter("testParam") %> </UL> </BODY> </HTML> 4 Kết quả 5 JSP/Servlets ofoto.com 6 First USA Bank 7 Delta Airlines 8 Script JSP 9 Biểu thức <%= expression %> <jsp:expression>Expression </jsp:expression> Hostname: <%= request.getRemoteHost() %> Code <% code %> <jsp:scriptlet>Code</jsp:scriptlet> <% String query = request.getQueryString(); %> Khai báo <%! code %> <jsp:declaration>Java Code</jsp:declaration> <%! private int someField = 5; %> 10 Biến có sẵn request - HttpServletRequest (1st doGet) response - HttpServletResponse (2nd doGet) session - HttpSession out - JspWriter application - ServletContext getServletConfig().getContext(). . 1 JavaServer Pages 2 Nội dung Giới thiệu JSP Các script JSP Các directive Chèn