最新下载
热门教程
- 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 }
%>
相关文章
- 荒原曙光黏土怎么获得 黏土获取攻略 10-15
- 荒原曙光奇物收容箱子怎么获得 奇物收容箱子获取攻略 10-15
- 荒原曙光雪莲怎么获得 雪莲获取攻略 10-15
- 荒原曙光怎么驯服动物 驯服动物方法 10-15
- 洛克王国世界火灵石怎么获得 火灵石获取攻略 10-15
- 洛克王国世界光灵石怎么获得 光灵石获取攻略 10-15