最新下载
热门教程
- 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 }
%>
相关文章
- 我的世界树脂砖怎么获得 树脂砖详细信息介绍 09-15
- 我的世界铜粒怎么获得 铜粒获取方法大全 09-15
- 我的世界下界砖有什么用 下界砖合成方法介绍 09-15
- 燕云十六声卷人不倦任务怎么做-万事知卷人不倦任务攻略 09-15
- 我的世界附魔之瓶有什么用 附魔之瓶获取途径介绍 09-15
- 我的世界骨粉怎么获得 骨粉多种用途介绍 09-15