Javaweb课后习题——设计表单,制作一个JSP文件,计算一个数的平方,然后再制作一个JSP文件,在客户端显示出来。要求,应用<jsp:include>动作加载上述JSP文件。
//Calsquare.jsp
<%@ page language="java" pageEncoding="utf-8"%>
<html>
<head>
</head>
<body>
<jsp:include page="square.jsp">
<jsp:param value="17" name="number"/>
</jsp:include>
</body>
</html>
//square.jsp
<%@page language="java" pageEncoding="utf-8"%>
<html>
<head>
</head>
<body>
<%
int number= Integer.parseInt(request.getParameter("number"));
out.println(number+"的平方是:"+number*number);
%>
</body>
</html>
//