Here's my JSP code. It was working fine some days back. But I'm unable to view the pdf file now.
<% String email = (String) session.getAttribute("email"); %>
<%
connection = DriverManager.getConnection(connectionUrl+database, userid, password);
String sql ="select resume from signup where email = ?";
ps = connection.prepareStatement(sql);
ps.setString(1,email);
resultSet = ps.executeQuery();
while(resultSet.next()){
byte [] resumeBytes = resultSet.getBytes("resume");
%>
<!DOCTYPE html>
<html>
<head>
<title>Your Resume</title>
</head>
<body>
<%
DataOutput dataOutput = new DataOutputStream(response.getOutputStream());
response.setContentType("application/pdf");
for(int i = 0; i < resumeBytes.length; i++){
dataOutput.write(resumeBytes[i]);
}
}
%>
"getOutputStream() has already been called for this response" is what the Exception is. Please help with this