首页 > Web开发 > 详细

JSP/Servlet及相关技术详解

时间:2017-08-19 12:02:44      阅读:299      评论:0      收藏:0      [点我收藏+]

 

JSP声明

技术分享

<%!声明部分%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>欢迎</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>
<%!
//声明一个整数变量
public int count;
/*
定义一个方法
*/
public String info(){
return "hello";
}
%>
<body>
this is my test page !
<br>
<%=count++ %>
<%=info() %>

</body>
</html>

技术分享

 

 输出JSP表达式

<%=表达式%>

<%=count++ %>
<%=info() %>

替代out.println输出语句,输出表达式语法后不能有分号

 JSP脚本

技术分享

JSP的3个编译指令

技术分享

 JSP脚本的9个内置对象

技术分享

 

JSP/Servlet及相关技术详解

原文:http://www.cnblogs.com/wxc-kingsley/p/7387720.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!