lian1.jsp:
<%@ page contentType="text/htmlcharset=gbk"%>
<html>
<head>
<title>加法</title>
</head>
<body>
<form action="lian2.jsp">
加数:<input type="text"name="jiashu1"><br>
加数:<input type="text"name="jiashu2"><br>
<input type="submit"name="submit"value="等于">
</form>
</body>
</html>
lian2.jsp:
<%@ page language="java" import="java.util.*" pageEncoding="gb2312"%>
<html>
<head>
<title>
和的值
</title>
</head>
<body>
<%
int a = Integer.parseInt(request.getParameter("jiashu1"))
int b = Integer.parseInt(request.getParameter("jiashu2"))
int c=a+b
%>
和为:<%=c %>
</body>
</html>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)