当前位置:网站首页>EL表达式改进JSP
EL表达式改进JSP
2022-07-25 21:50:00 【华为云】
目录
EL表达式改进JSP
JSP的缺点
由于jsp页面内,既可以定义HTML标签,又可以定义java代码,造成了以下问题
1、书写麻烦:特别是复杂的页面
2、阅读麻烦
3、复杂度高:运行需要依赖各种环境,JRE。JSP容器(tomcat服务器).....
4、占用内存和磁盘:JSP会自动生成.java和.class文件占磁盘,运行.class文件占内存
5、调试困难:出错后,需要找到自动生成的.java文件进行调试
6、不利团队写作:前后端人员
...
JSP已经逐渐退出历史舞台,取而代之的是html和Ajax
演化过程:
最好不要直接在jsp里写java代码
EL表达式
Expression Language表达式语言,用于简化JSP页面内的java代码
主要功能:获取数据
语法:${expression}
如:${brands}:获取域中存储的key为brands的数据
idea中使用Maven时常见问题
idea中使用了maven无法创建包/类
没有源文件,将其中的一个文件添加为源文件,就可创建包或类了(项目结构中标蓝)
idea中配置web的maven项目
maven创建的web中无法创建servlet
maven中部署tomcat插件
pom.xml文件中写入
EL表达式的演练
创建一个com.web.ServletDemo1类
在web.app目录下创建el-demo.jsp,其中写入${lists}即可
运行结果
边栏推荐
猜你喜欢

人脸与关键点检测:YOLO5Face实战

Bitcoin.com:usdd represents a truly decentralized stable currency
![[database] conceptual design, logical design, relational database design theory](/img/4d/be7ab21c98fc1bf4b63e4abe22d9fc.png)
[database] conceptual design, logical design, relational database design theory

Special class design

MySQL master-slave configuration

CNN structural design skills: taking into account speed accuracy and engineering implementation

Oracle RAC RMAN backup error ora-19501 ora-15081

The adequacy of source evaluation forum · observation model test
![[MAIXPY]kpu: load error:2005, ERR_READ_FILE: read file failed问题解决](/img/0b/da67b5a361a2cdfaf81568d34cf5f7.png)
[MAIXPY]kpu: load error:2005, ERR_READ_FILE: read file failed问题解决

FAW red flag "King fried" is listed, which is safe and comfortable
随机推荐
全志芯片bsp命名规则
2022 latest examination questions and answers of eight members (standard staff) of Shanghai Architecture
Detailed explanation of Ag search tool parameters
Basic knowledge in the project
Mysql8.0 MHA to achieve high availability "MHA"
Guys, how can Flink SQL submit tasks in per job mode?
Unity Metaverse(二)、Mixamo & Animator 混合树与动画融合
Pyqt5 use pyqtgraph to draw multiple y-value scatter plots
[JS] the problem pointed by this
Special symbols in shell
【饭谈】测试平台为什么有组件化?模块化?很多看不到的地方设计的很好是种浪费么?
Oxford University: many common insomnia drugs lack long-term safety data
redis主从架构锁失效问题(主从)
golang : MVC之models
Six principles of C program design
Oracle RAC RMAN backup error ora-19501 ora-15081
ansible+Crontab批部署巡检
新版Maixhub部署(V831与K210)
【饭谈】软件测试薪资层次和分段(修仙)
Special class design





