JSP使用chart.jsp报name cannot be resolved
在jsp页面使用chart.jsp报namecannotberesolved。同样的代码将jsp换为html,去掉<%@pagelanguage="java"import...
在jsp页面使用chart.jsp报name cannot be resolved。同样的代码将jsp换为html,去掉<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>就是正常的,这是什么缘故?
An error occurred at line: 189 in the jsp file: /page/demo/chart.jsp
name cannot be resolved
186: //Boolean - Whether to fill the dataset with a color
187: datasetFill: true,
188: //String - A legend template
189: legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\"background-color:<%=datasets[i].lineColor%>\"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>",
190: //Boolean - whether to maintain the starting aspect ratio or not when responsive, if set to false, will take up entire container
191: maintainAspectRatio: true, 展开
An error occurred at line: 189 in the jsp file: /page/demo/chart.jsp
name cannot be resolved
186: //Boolean - Whether to fill the dataset with a color
187: datasetFill: true,
188: //String - A legend template
189: legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\"background-color:<%=datasets[i].lineColor%>\"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>",
190: //Boolean - whether to maintain the starting aspect ratio or not when responsive, if set to false, will take up entire container
191: maintainAspectRatio: true, 展开
2个回答
2016-11-03
展开全部
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>是声明JSP的,有这个声明才会编译运行,JSP是先在java后台编译运行,将<%=name.toLowerCase()%>中的java代码运行之后,将返回的结果转为HTML在网页展示。HTML则只是浏览器解析,展示内容。
这个错误是你的name变量定义错误,看下你的name在哪里定义的,是否是String类型的
这个错误是你的name变量定义错误,看下你的name在哪里定义的,是否是String类型的
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询