Pessoal to querendo fazer um upload de um arquivo mais está apresentando erro:
Segue código:
<!DOCTYPE html>
<%@page contentType="text/html" pageEncoding="ISO-8859-1"%>
<%@page import="java.io.*"%>
<%@page import="java.util.*"%>
<%@page import="org.apache.commons.fileupload.*"%>
<%@page import="br.com.unimed.portal.colaborador.validation.ErroItemColaborador"%>
<%@page import="br.com.unimed.portal.colaborador.CargaColaborador"%>
<%
try {
DiskFileUpload fu = new DiskFileUpload();
List fileItems = fu.parseRequest(request);
File file = (File) fileItems;
//Importa arquivo CSV
CargaColaborador cargaColaborador = new CargaColaborador(file);
List<ErroItemColaborador> erros = cargaColaborador.lerArquivoCsv();
for (ErroItemColaborador erro : erros) {
for (String erroString : erro.getErrors()) {
out.println(erro.getRegistro() + " - " + erroString);
}
}
} catch (Exception e) {
out.println(e.toString());
}
%>
seguinte erro é apresentado:
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 9 in the jsp file: /pessoas/uploadCSV.jsp
Generated servlet error:
Syntax error on token "<", invalid AssignmentOperator
An error occurred at line: 9 in the jsp file: /pessoas/uploadCSV.jsp
Generated servlet error:
Syntax error on token "=", != expected
An error occurred at line: 9 in the jsp file: /pessoas/uploadCSV.jsp
Generated servlet error:
Syntax error on token(s), misplaced construct(s)
An error occurred at line: 9 in the jsp file: /pessoas/uploadCSV.jsp
Generated servlet error:
Syntax error on token ")", : expected
An error occurred at line: 9 in the jsp file: /pessoas/uploadCSV.jsp
Generated servlet error:
Syntax error on token ":", ; expected
An error occurred at line: 9 in the jsp file: /pessoas/uploadCSV.jsp
Generated servlet error:
Syntax error on token ")", ; expected after this token