第2章初探JSP JSP运行环境要求 JDK:Java应用程序开发包,包含编译运行Java程序所需的工具包和开发Java 应用程序所需的类函数库。 Tomcat服务器软件:解释JSP网页,并且回传解释过后的JSP网页至用户计算 机的浏览器 JSP动态网页新技术
第2章 初探JSP JSP 动态网页新技术 1 JSP 运行环境要求 JDK:Java应用程序开发包,包含编译运行Java程序所需的工具包和开发Java 应用程序所需的类函数库。 Tomcat服务器软件:解释JSP网页,并且回传解释过后的JSP网页至用户计算 机的浏览器
第2章初探JSP 建立与测试开发环境 server. xm 编辑设定 server.xn1-记事本 回囟 文件)编辑)格式Q)查着Q帮助⑩ Define the default virtual host ote: XML Schema validation will not work with Xerces 2.2. st name= localhost appEase="webapps unpack WARs=" true autoDeploy=true xmlValidation=false xmINamespaceAware="false"> <!-- Defines a cluster for this node By defining this element, means that every manager will be So when running a cluster, only make sure that you hare webapps in that need to be clustered and remove the other ones A cluster has the following parameters className the fully qualified name of the cluster cass v JSP动态网页新技术 2
第2章 初探JSP JSP 动态网页新技术 2 建立与测试开发环境 ➢ server.xml 编辑设定
第2章初探JSP 建立与测试开发环境 网址 http://ocalhost:8080/testjsp 文件位置: C:TestJSP JSP动态网页新技术 3
第2章 初探JSP JSP 动态网页新技术 3 建立与测试开发环境 http://localhost:8080/TestJSP ➢网址: ➢文件位置: C:\TestJSP
第2章初探JSP JSP的运行 网站服务器 向服务器提出网页內容请求 dxxX. sp Jsp 网络 Servlet 浏览器 编译 Servlet Servlet运行文件 Servlet回应浏览器请求 JSP动态网页新技术
第2章 初探JSP JSP 动态网页新技术 4 JSP的运行 向服务器提出网页內容请求 xxx.jsp Servlet 回应浏览器请求 Servlet 网站服务器 网络 xxx.jsp 浏览器 Servlet 运行文件 编译 Servlet
第2章初探JSP JSP程序结构 <%o@page contentType="text/html%> <%o@page page Encoding="GB23129> JSP指令 <html> < head><title>request型态的生命周期</to<head> <font color"red">request jsp</font><br><br> 您是 request. jsp网页的第< font color-blue> <isp: getProperty name="countrproperty=counter param="the Count2 <font>位浏览者<br> JSP标签 out. printIn("这是 request. jsp网页的计数器!" > Script ybody> JSP动态网页新技术 5
第2章 初探JSP JSP 动态网页新技术 5 JSP 程序结构 <%@page contentType="text/html"%> <%@page pageEncoding="GB2312"%> <html> <head><title>request 型态的生命周期</title></head> <body> <font color="red">request.jsp</font><br><br> 您是request.jsp网页的第<font color=blue> <jsp:getProperty name="countr" property="counter" param="theCount"/> </font>位浏览者<br> <% out.println(" 这是request.jsp网页的计数器 !!"); %> </body> </html> } JSP 指令 JSP标签 Java Script