Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to display the images from folder in jsp

807605Aug 23 2007 — edited Aug 23 2007
Iam new to java..

I want to display the images (.jpeg,,.gif, flash) which are kept in one folder
Using Jsp...
Its Executing fine in local system..
Its not working 1)when i execute that jsp from other system
2)if i give the full url then only its executing in local system
Please help me...
thanks in advance...
by Priya
<%@ page import="java.io.*"%>

<html>
<head>
<title>Movie Details</title>
</head>

<body text="#000000" bgcolor="#FFFFFF">
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#FFFFFF" width="100%" id="AutoNumber1">
<%
File f=new File("..E:\application\Images"); 
  File []f2=f.listFiles();
 
  for(int ii=0;ii<f2.length;ii++)
  {
    if(f2[ii].isFile())
    {
   
    String fname=f2[ii].getPath();
    %>
    <tr>
    <td width="87%"><%=fname%>�</td>
    
    <td width="14%"><img border="0" src="<%=fname%>" width="150" height="100" ></td>
  </tr>
        
    <%
    System.out.println(f2[ii].getPath());
     }
     
   }
%>


  
 
</table>

</body>

</html>
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 20 2007
Added on Aug 23 2007
6 comments
7,269 views