我建了一个index.jsp文件,但是如何在这个JSP文件中输入相应内容

来源:百度知道 编辑:UC知道 时间:2024/07/05 04:53:44
我打不开文件,输入不了内容
<html>
<body>
<center>
Now time is: <%=new java.util.Date()%>
</center>
</body>

</html>
。谢谢
.在myapp下新建一个测试的jsp页面,文件名为index.jsp,文件内容如下:
<html>
<body>
<center>
Now time is: <%=new java.util.Date()%>
</center>
</body>

</html>
那按你说的上面得怎么弄了

这个页面不是JSP的 是HTML的静态页面
JSP页面参考如下:
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%
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-equi