JSP day 1
来源:互联网 发布:五十知天命六大而耳顺 编辑:程序博客网 时间:2024/05/29 17:04
JSP 教程:
http://www.w3cschool.cc/jsp/jsp-tutorial.html
分析案例一:
deliveryin.jsp;
<%@page contentType="text/html"%>
<html>
<head><title>Deliver In</title></head>
<body>
<jsp:include page="header.html" flush="true"/>
<script language="JAVASCRIPT">
function checkData() {
document.scanForm.submit();
return true;
}
</script>
<br>
<h2>Please enter serial numbers and pick location, logop</h2>
<form name='scanForm' action='deliverinresults.jsp' METHOD='POST'> <%-- 数据如何提交? POST --%>
deliverinresults.jsp
<%@ page language="java" import="java.net.Socket,com.sun.wwops.tie.mint.tools.*"%>
<html>
<head><title>Deliver In</title></head>
<body>
<jsp:include page="header.html" flush="true"/>
<% out.flush(); <%-- out.flush() 通过查询,为缓冲区的内容输出到客户端浏览器 --%>
com.sun.wwops.tie.mint.controller.DeliverInController ctr = new com.sun.wwops.tie.mint.controller.DeliverInController(); <%-- ????--%>
ctr.deliverIn( request, response, out );
%>
</body>
</html>
语法格式定义:
<jsp:scriptlet> 代码片段</jsp:scriptlet>或者
<% 代码片段 %>
第一个程序:
<head><title>Hello World</title></head>
<body>Hello World!<br/><%out.println("Your IP address is " + request.getRemoteAddr());%></body></html>
变量声明
<%! declaration; [ declaration; ]+ ... %>
例:
<%! int i = 0; %>
<%! int a, b, c; %>
<%! Circle a = new Circle(2.0); %>
表达式
<%= 表达式 %> or <jsp:expression> 表达式 </jsp:expression>
例:
<html>
<head><title>A Comment Test</title></head>
<body><p> Today's date: <%= (new java.util.Date()).toLocaleString()%></p></body> </html>
- JSP day 1
- Day 05 JSP基本知识
- Day 06 JSP
- Day 1
- day 1
- DAY 1
- day 1
- day-1
- DAY 1
- Day 1
- day(1)
- day 1
- Day 1
- Day 1
- Day-1
- DAY-1
- Day 1
- Day 1
- 单色背景抠图方法(绿色背景抠图、肤色检测)之——chroma kye
- scanf family API 高级用法
- 嵌入式学习笔记(1)之ROM、RAM、DRAM、SRAM和FLASH的概念
- 传真移动办公的演变
- ffmpeg configure
- JSP day 1
- 我的中兴五年
- 关于css中float的用法整理及清除浮动方法。
- 销售订单状态
- Windows7硬盘安装CentOS6.2超详细图文教程(双系统)
- cannot open git-upload-pack问题 cannot open git-upload-pack
- POJ-1861 Network
- struts2的action里定义的serialVersionUID是干什么用的啊?
- 细说sybase日志-