
单个jsp的问题,<%= aVector %> 里aVector报错:aVector cannot be resolved to a variable,jsp代码如下
用Eclipse写的jsp:<%@pagelanguage="java"contentType="text/html;charset=utf-8"pageEncoding...
用Eclipse写的jsp:
<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8utf-8">
<title>Insert title here</title>
</head>
<body>
<%@ page language = "java" %>
<%!
int anInt =3 ;
boolean aBool = true;
Integer anIntObj = new Integer(3);
Float aFloatObj = new Float(8.6);
String str = "some string";
StringBuffer sBuff = new StringBuffer();
char getChar(){return 'A';}
int i;
%>
<%= 500 %>
<%= anInt*3.5/100-500 %>
<%= aBool %>
<%= false %>
<%= !false %>
<%= getChar() %>
<%= Math.random() %>
<%= aVector %>
<%= aFloatObj %>
<%= aFloatObj.floatValue() %>
<%= aFloatObj.toString() %>
<%= aBool %>
<%= i = 20 %>
<%= sBuff.setLength(12) %>
</body>
</html> 展开
<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8utf-8">
<title>Insert title here</title>
</head>
<body>
<%@ page language = "java" %>
<%!
int anInt =3 ;
boolean aBool = true;
Integer anIntObj = new Integer(3);
Float aFloatObj = new Float(8.6);
String str = "some string";
StringBuffer sBuff = new StringBuffer();
char getChar(){return 'A';}
int i;
%>
<%= 500 %>
<%= anInt*3.5/100-500 %>
<%= aBool %>
<%= false %>
<%= !false %>
<%= getChar() %>
<%= Math.random() %>
<%= aVector %>
<%= aFloatObj %>
<%= aFloatObj.floatValue() %>
<%= aFloatObj.toString() %>
<%= aBool %>
<%= i = 20 %>
<%= sBuff.setLength(12) %>
</body>
</html> 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询