当前位置:网站首页>jsp学习1
jsp学习1
2022-04-23 14:05:00 【你若信】
<%@ page contentType="text/html; charset=UTF-8" pageEnconding="UTF-8" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>认识jsp</title>
</head>
<body>
1、<%--jsp注释--%>
与html的注释<!---->区别:前端页面可以看到html的注释,而jsp的注释不会被看见
2、jsp的Java代码块
<%--
在jsp中想要写Java代码,并执行需要将其写到
<%
Java代码块
%>
必须以分号结尾,声明变量时不能加访问权限控制符(如:private),不能定义方法,不能定义静态代码块
--%>
<%
String a="帅哥";
System.out.println(a);
%>
3、声明语句块
<%--
<%!声明语句%>
可以添加访问权限,可以定义方法,可以定义静态代码块
--%>
<%!
public void hu(){
System.out.println("lllll");
}
%>
<%
hu();
%>
4、表达式块
<%
String a="kkk";
%>
<%=a%><%--加等号可以直接输出--%>
</body>
</html>
版权声明
本文为[你若信]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_44152890/article/details/123720492
边栏推荐
猜你喜欢
随机推荐
微信小程序与低功耗蓝牙通信-接受硬件端发送来的数据(四)
Lin Lin, product manager of Lenovo: network failure of local network operator in Tianjin. The background server of Zui system can't work normally for the time being
生成随机高质量符合高斯分布的随机数
Subscription number development of wechat applet (message push)
scikit-learn構建模型的萬能模板
Mysql个人学习总结
微信小程序基于udp协议与esp8266进行通信
Mock测试
Yarn online dynamic resource tuning
初识go语言
JS force deduction brush question 102 Sequence traversal of binary tree
_模_板_
leetcode--357. Count the number of different figures
FBS(fman build system)打包
Kettle -- control parsing
Program compilation and debugging learning record
不同时间类型的执行计划计算
leetcode--380. O (1) time insertion, deletion and acquisition of random elements
1256: bouquet for algenon
Record a strange bug: component copy after cache component jump