问题:通过表单输入一个正整数n,然后通过动作标记include插入一个计1-n累加程序。
sum.jsp使用include动作标记动态加载add.jsp页面
sum.jsp 的代码
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>1-n的累加</title>
</head>
<body><FONT Size=2>
<table border = 1>
<tr><th>累加1-n</th>
</tr>
<tr><td><jsp:include page="include1.jsp"></jsp:include></td></tr>
</table>
</FONT>
</body>
</html>
add.jsp被加载提供sum.jso页面1-n的计算总和
add.jsp的代码
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<