最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
jsp include两种调用形式详细
时间:2022-06-29 02:39:42 编辑:袖梨 来源:一聚教程网
include有两种形式,分别是Include指令:和include动作:jsp教程:include page="" flush="true"/>
include调用文件
,是将被引入的JSP与原JSP融合到一起,而这个融合过程是在翻译阶段进行的
index.jsp
Flavors
Our most popular flavors are:
Try them all!
flavor_list.html
- Chocolate
- Strawberry
- Vanilla
常当应用程序中所有的页面的某些部分(例如标题、页脚和导航栏)都相同的时候,我们就可以考虑用include。具体在哪些时候用,哪些时候用
include一个页面的地址
Flavors
Our most popular flavors are:
Try them all!
根据用户提交的参数请求,我们调用不用的文件
实例
// Diameter of the earth in kilometers
int distance = 12756;
%>
Diameter of the Earth in SI (Metric) Units
Diameter of the Earth in U.S. Customary Units
ShowDiameter.jsp
String dist = request.getParameter("dist");
if (dist == null)
throw new ServletException
("No distance parameter specified");int kilometers = Integer.parseInt(dist);
double miles = kilometers / 1.609344;String units = request.getParameter("units");
if (units == null)
throw new ServletException
("No units parameter specified");if (units.equals("SI")) {
%> Diameter = km }
else {
%> Diameter = miles }
%>
相关文章
- 漫蛙在线最新网页打不开解决方法-真实可用入口安装教程在此 02-25
- 汗汗漫画-韩漫最新入口 02-25
- 麻花豆免费版-最新入口 02-25
- 漫蛙manwa2下载安卓苹果电脑版_下载前先看这几个常见问题 02-25
- Deepseek中文版下载-Deepseek在线体验平台 02-25
- DeepSeek官网-网页版一键直达 02-25