jsp入门小程序
2016-09-03 10:56
204 查看
showTime.jsp文件:
运行:http://localhost:8080/JspProject/showTime.jsp
结果:现在是: 2016-9-3 10:51:08
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <% 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>第一个jsp:显示时间的jsp</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> 现在是: <% Date now = new Date(); out.write(now.toLocaleString()); %> </body> </html>
运行:http://localhost:8080/JspProject/showTime.jsp
结果:现在是: 2016-9-3 10:51:08
相关文章推荐
- jsp环境搭建,入门示例程序
- [原]java专业程序代写(qq:928900200),学习笔记之基础入门<jsp>(二十六)
- Java语言程序设计-Eclipse入门之Servlet/JSP程序与例1-3、1-4程序
- 手把手做一个JSP入门程序(九):购物车的基本实现(Servlet)
- 手把手做一个JSP入门程序(八):登陆注册(Servlet)
- Javaweb 入门测试程序(jsp)
- 手把手做一个JSP入门程序(一):程序基本介绍(JSP)
- JSP入门之HelloWorld程序实例
- 手把手做一个JSP入门程序(六):获取单一商品详情(JSP)
- jsp简单入门及用jsp写各种java写过的小程序
- JSP入门之HelloWorld程序实例
- 手把手做一个JSP入门程序(四):商品实体类设计(JSP)
- 第二周学习计划:继续学java入门,开始做些小jsp+java程序
- 第一个JSP程序(JSP入门)
- 手把手做一个JSP入门程序(五):获取所有商品渲染主页(JSP)
- 菜鸟上路-JSP+JavaBean小程序入门
- jsp简单入门及用jsp写各种java写过的小程序
- 手把手做一个JSP入门程序(七):使用Cookie实现浏览记录(JSP)
- 手把手做一个JSP入门程序(二):创建一个项目(JSP)
- COM程序编写入门(全文-2)