<%@?page?language="java"?import="java.util.*"?contentType="text/html;?charset=utf-8"%>
<%@page?import="java.text.*"?%>
<%@page?import="java.lang.String"?%>
<%
String?path?=?request.getContextPath();
String?basePath?=?request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
?
<!DOCTYPE?HTML?PUBLIC?"-//W3C//DTD?HTML?4.01?Transitional//EN">
<html>
??<head>
????<base?href="<%=basePath%>">
?????
????<title>My?JSP?'index.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>
??<!--?我是html注釋,可在客戶端看見?-->
??<%--我是JSp注釋,在客戶端不可見?--%>
??<%?/*我是腳步注釋*/
???%>
???<h1>九九乘法表</h1>
????<hr>
???<%!//定義自定義變量或方法
?????????String?fangfa(){
?????????String?s="";
?????????for(int?i=1;i<=9;i++){
????????????for(int?j=1;j<=i;j++){
????????????????int?c=i*j;
????????????????s=i+"*"+j+"="+c;
????????????????}
?????????????????s=s+"<br>";
????????????}
????????????return?s;
????????????}
????%>
???<%
???SimpleDateFormat?date=new?SimpleDateFormat("yyyy/MM/dd");
???String?d?=date.format(new?Date());
????%>
????今天是:<%=d?%>+"<br>"
????
????<%=fangfa()%>
??</body>
</html>但效果是這樣,求大神指點(diǎn)哪里問題要求:http://idcbgp.cn/qadetail/179761
JSP腳步運(yùn)行?
黃森h(huán)uang
2016-11-07 19:19:37