Unit04: JSP基本语法 、 JSP运行原理
hello.jsp
<%@page pageEncoding="utf-8"%>第一个JSP <%! public double pf(double d) { return d*d; } %>
- <% for(int i=0;i<10;i++) { %>
- <%=pf(Math.random()) %> <% } %>
time.jsp
<%@page pageEncoding="utf-8" contentType="text/html" import="java.util.*,java.text.*"%><% Date date = new Date(); SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); String now = sdf.format(date);%><%=now %>