1
<%@page import="<PackageName>.*" %>
<%@page import="java.util.ArrayList" %>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
</head>

<%  
int propertyCount=0;
ArrayList<String> MsgFlow =new ArrayList<String>();
ArrayList<String> ProValue= new ArrayList<String>();
ArrayList<String> PropertyKey= new ArrayList<String>();
if(request.getAttribute("Populate")!=null){

BeansOverride beans = new BeansOverride();
beans = (BeansOverride) request.getAttribute("Populate");

MsgFlow = beans.getMsgFlows();  
ProValue = beans.getProValue();
PropertyKey = beans.getPropertyKey();
MsgFlow.add("Abd");
ProValue.add("Name");
PropertyKey.add("Fjrk");

propertyCount = MsgFlow.size();
}
%>

错误

HTTP 状态 500 - 无法为 JSP 编译类:


类型异常报告

消息无法为 JSP 编译类:

描述 服务器遇到一个内部错误,阻止它完成这个请求。

exception 

org.apache.jasper.JasperException: Unable to compile class for JSP: 

An error occurred at line: 18 in the jsp file: /Home.jsp
BeansOverride cannot be resolved to a type
15: ArrayList<String> PropertyKey= new ArrayList<String>();
16: if(request.getAttribute("Populate")!=null){
17: 
18: BeansOverride beans = new BeansOverride();
19:     beans = (BeansOverride) request.getAttribute("Populate");
20:     
21:     MsgFlow = beans.getMsgFlows();  
4

1 回答 1

0

它找不到类BeansOverride

改变

<%@page import="<PackageName>.*" %>

使其包含BeansOverride

根据您的评论,您需要将类包名称与 jsp 导入名称匹配。

所以。将班级更改为

package com.cts;

正如在 Java 的默认包中导入类的语法是什么?

导入一个类是非法的

于 2013-09-11T07:15:42.007 回答