当前位置:网站首页>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
边栏推荐
- CDH cluster integration Phoenix based on CM management
- 微信小程序 input隐藏和不可操作的设置
- 微信小程序进行蓝牙初始化、搜索附近蓝牙设备及连接指定蓝牙(一)
- 分库分表 & ShardingSphere
- The latest development of fed digital currency
- 生产环境——
- Android: answers to the recruitment and interview of intermediate Android Development Agency in early 2019 (medium)
- Pytorch 经典卷积神经网络 LeNet
- 多线程 @Async 线程池
- 对List集合进行分页
猜你喜欢
Prediction of tomorrow's trading limit of Low Frequency Quantization
DeepinV20安装Mariadb
1256: bouquet for algenon
基于ibeacons签到系统
Mock测试
Nodejs安装及环境配置
Neuron and neural network
CentOS mysql多实例部署
基于Ocelot的gRpc网关
org.apache.parquet.schema.InvalidSchemaException: A group type can not be empty. Parquet does not su
随机推荐
微信小程序通过低功耗蓝牙设备进行定位及测距(二)
groutine
读了一篇博客,重新理解闭包整理一下
微信小程序与低功耗蓝牙通信-往硬件端发送数据(三)
Universal template for scikit learn model construction
Record a strange bug: component copy after cache component jump
STM32学习记录0007——新建工程(基于寄存器版)
Pytorch 经典卷积神经网络 LeNet
DDT+Excel进行接口测试
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
使用Postman进行Mock测试
帆软实现分页时第一行和最后两行冻结方式
百度图片识别自定义实现(替代AipOcr)
Wechat applet initializes Bluetooth, searches nearby Bluetooth devices and connects designated Bluetooth (I)
RobotFramework 之 用例执行
网站_收藏
微信小程序setInterval定时函数使用详细教程
1256: bouquet for algenon
多重继承虚基类习题
烟雾传感器(mq-2)使用详细教程(基于树莓派3b+实现)