Fala gente boa.
Alguém saberia me ajudar?
Estou tentando responder a uma solicitação para um servlet ( parte do código do servlet está aí), mas quero devolver o texto de um arquivo html, que está em outra pasta, nome da pasta html, está no diretório antes desse. Ou seja, leio o texto do arquivo html, e respondo com esse texto html.
Tentei fazer da seguinte forma mais não deu certo.
response.setContentType("text/html");
File file = new File("../html/teste.html");
OutputStream fileout = new FileOutputStream(file);
fileout = response.getOutputStream();
PrintWriter saida = new PrintWriter(fileout);
saida.println();
fileout.close();
saida.close();
O arquivo html é um página. Alguém saberia me dizer como fazer isso?
Valeu!