JSP para fazer upload de arquivo .xls(excel)

1 resposta
gabriel.coelho

Galera, tenho uma jsp com a tag para realizar o upload de um arquivo .xls(excel), porém a tela não abre utilizando essa tag. Estou usando Struts 1.2 e Weblogic 8.1. Me falaram q com essas configurações do meu ambiente funcionaria utiliando o

ao invés do , porém nao sei como criar essa jsp utilizando o

Aguém pode ajudar??

Segue JSP:

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>

<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>

<html>
<head>
<title>Upload de arquivo</title>
</head>

<body>
<html:form action="upload.do?action=baixarArquivo" enctype="multipart/form- data">
<html:file property="file" styleId="file" alt="Selecione um arquivo." ></html:file>
<br><br>
<html:submit value="Confirmar"></html:submit>
</html:form>
</body>
</html>

Segue Bloco em Struts(Caso ajude):

<action path="/upload.do"
[quote]type="br.com.upload.action.UploadAction"
name="uploadArquivoForm"
scope="request"
validate="false"
parameter="action">
<forward name="confirmar" path="/pages/upload.jsp" />
</action>

Obrigado...Gabriel.

1 Resposta

edilson_x

Tenta fazer seu form parecido com este, uso struts 1.x e assim funciona

<%@ 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>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<form id="inputForm" name="inputForm" method="post" action="upload.do" enctype="multipart/form-data">

<input type="hidden" id="tipoForm" name="tipoForm" value="imagem">

<input name="arquivo" type="file" accept="text/rtf; " id="arquivo" class="dados" maxlength="60" tabindex="1" value="c:/" style="position:absolute; top:23px; left:12px;  width:500px; ">

<input type="submit" id="upload" name="upload" tabindex="2" style="position:absolute; top:20px; left:532px;" >
 
</form>
</body>
</html>
Criado 12 de novembro de 2008
Ultima resposta 12 de nov. de 2008
Respostas 1
Participantes 2