<%@ page language="java" import = "java.io.*,java.util.*,java.text.*"
session = "false" buffer="12kb" autoFlush="true" info="my page directive jsp" errorPage="Error.jsp" %>
<%!
private static final DecimalFormat FMT = new DecimalFormat("#0.00");
%>
<html>
<head>
<title>Fuel Efficienty Conversion Chart</title>
</head>
<body>
<h3>Fuel Efficienty Conversion Chart<h3>
<table border="1" cellpadding="3" cellspacing="0">
<tr>
<th>kilometers per liter</th>
<th>miles per gollon</th>
</tr>
<%
for(double KPL = 5; KPL<=20;KPL+=1.0){
double mpg=KPL * 2.352146;
}
%>
<tr>
<td><%=FMT.format(KPL)%></td>
<td><%FMT.format(mpg)%></td>
</tr>
</table>
</body>
</html>
"jsp1.jsp": jspc failed with errors :weblogic.servlet.jsp.CompilationException: jsp1.jsp:23:27: 在此位置找不到任何具有此名称的变量或字段。
就是KPL和mpg我没分了
怎么办
不会介意吧
session = "false" buffer="12kb" autoFlush="true" info="my page directive jsp" errorPage="Error.jsp" %>
<%!
private static final DecimalFormat FMT = new DecimalFormat("#0.00");
%>
<html>
<head>
<title>Fuel Efficienty Conversion Chart</title>
</head>
<body>
<h3>Fuel Efficienty Conversion Chart<h3>
<table border="1" cellpadding="3" cellspacing="0">
<tr>
<th>kilometers per liter</th>
<th>miles per gollon</th>
</tr>
<%
for(double KPL = 5; KPL<=20;KPL+=1.0){
double mpg=KPL * 2.352146;
}
%>
<tr>
<td><%=FMT.format(KPL)%></td>
<td><%FMT.format(mpg)%></td>
</tr>
</table>
</body>
</html>
"jsp1.jsp": jspc failed with errors :weblogic.servlet.jsp.CompilationException: jsp1.jsp:23:27: 在此位置找不到任何具有此名称的变量或字段。
就是KPL和mpg我没分了
怎么办
不会介意吧
private static final DecimalFormat FMT = new DecimalFormat("#0.00");
private double KPL, mpg;
%>