<%@ page language="java" import="java.util.*" pageEncoding="gb2312"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'index.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/html" href="styles.css">
-->
</head>
<body>
半径为<%=r %>的圆的面积为:<br>
<% =area(r)%>
<%!
double area(double r){
return r*r*pi;
}
%>
<%!
double r=10;
final double pi=3.14;
%>
</body>
</html>
编译运行后显示的是 jsp文件无法编译Java类
是什么原因
谢谢解答!!!
相关分类