
Hi all,
I have placed all the jsps in pages folder and images in images folder. in pages folder i placed login.jsp and in images folder i placed tatalogo3.jpg. following is login.jsp
|
|
|
And i am forwarding request to this login.jsp from a filter like this
request.getRequestDispatcher("login.jsp").forward(request, response);
Above line is forwarding the request to login.jsp correctly, but in login.jsp the image is not displaying. Can you help me in resolving this problem.
Thanks & Regards, Suresh

Jsp Display Image
<%@ page import="java.io.*" %>
<%@page contentType="image/gif" %><%
OutputStream o = response.getOutputStream();
InputStream is = new FileInputStream(new File("C:/images/image.gif"));
byte[] buf = new byte[32 * 1024];
int nRead = 0;
while( (nRead=is.read(buf)) != -1 ) {
o.write(buf, 0, nRead);
}
o.flush();
o.close();
return;
%>
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.