当先锋百科网

首页 1 2 3 4 5 6 7

使用JSP编程实现?

确定使用JSP实现么

<%@ page language="java" contentType="text/html; charset=UTF-8"

pageEncoding="UTF-8"%>

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>Insert title here</title>

</head>

<%

String temp1 = request.getParameter("num1");

String temp2 = request.getParameter("num2");

String max = null;

if (temp1 != null && temp2 != null) {

int a = Integer.parseInt(temp1);

int b = Integer.parseInt(temp2);

max = String.valueOf(Math.max(a, b));

}

%>

在java中从键盘输入,使用JSP编程实现