标签:imp expires ges cache 重复 import 使用 return image
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><title>My JSP ‘script.jsp‘ starting page</title><meta http-equiv="pragma" content="no-cache"><meta http-equiv="cache-control" content="no-cache"><meta http-equiv="expires" content="0"><meta http-equiv="keywords" content="keyword1,keyword2,keyword3"><meta http-equiv="description" content="This is my page"><!--<link rel="stylesheet" type="text/css" href="styles.css">--></head><body><!-- jsp表达式 --><%//局部变量String name = "木丁西";int a = 5;int b = 9;class Person{public void print(){System.out.println("哈哈哈哈");}};new Person().print();%><%= name %><hr/>a+b=<%= a+b %><hr/><!-- jsp脚本 --><%//生成随机数Random random = new Random();float num = random.nextFloat();%>生成随机浮点数:<%= num %><hr/><!-- 掺插html代码 --><%for(int i=1; i<7; i++){%><h<%=i %>>标题<%=i %></h<%=i %>><%}%><hr/><!-- 使用脚本和html代码显示99乘法表 --><%for(int row=1; row<=9; row++){//9行for(int col=1; col<=row; col ++){%><%=row %>x<%=col %>=<%=col*row %> <%}%><br/><%}%><!-- jsp声明 --><%!//成员变量String name = "刘先森";//成员方法public String getName(){return name;}/* jsp声明中不能重复定义翻译好的一些方法。public void _jspInit() {}*/%><h1>这里会显示出来嘛</h1><%--<!-- html注释:html的注释会被翻译和执行<% Thread.sleep(4000);%> <jsp:forward page="/hello.jsp"></jsp:forward> -->--%><%--jsp注释:而jsp的注释不能被翻译和执行 --%></body></html>

标签:imp expires ges cache 重复 import 使用 return image
原文地址:http://www.cnblogs.com/itMiracle/p/6163230.html