小编Ven*_*nki的帖子

在jsp中无法解析列表

下面的代码用于显示来自服务器文件夹的图像,但列表显示的是无法解析的类型。使用servlet代码“private static final String UPLOAD_DIRECTORY = "upload";”将图像上传到文件夹中 现在我想将所有图像显示到 jsp 页面。请帮忙

<%@ page import ="java.io.*"%>;
<%@ page import ="java.io.File.*"%>;
<%@ page import="java.sql.*"%>
<%@ page import="javax.sql.*"%>
<%@ page import ="java.util.ArrayList.*"%>
<%@ page import ="java.util.List.*"%>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>File Upload Example</title>
    </head>
    <body> 
        <div id="result">
            <h3>${requestScope["message"]}</h3>
        </div>

        <%
            List imageUrlList = new ArrayList(); //List cannot be resolved type
            File imageDir = new File("Upload");
            for (File imageFile : imageDir.listFiles()) {
                String imageFileName = imageFile.getName();

                // add this images name to the …
Run Code Online (Sandbox Code Playgroud)

java import jsp

0
推荐指数
1
解决办法
7955
查看次数

标签 统计

import ×1

java ×1

jsp ×1