This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

To create a web page to show all the files in a unix directory.  RSS feed

 
kaushik Raman
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
My requirements are given below-
-1. To create a web page to show all the files in a unix directory.
2. Contents of the file should be displayed clicking on it.
3. If any new file is added in that directory, corresponding hyperlink should be created automatically on the webpage.

Solution : I have created following jsp running on WEBLOGIC server to fulfill the above req.
it is catering to the points 1 & 2 but I need to redeploy the application again if a file is added to directory

Problem : How do I get away with Redploying the application each time I add a file ?



<HTML>
<body>
<h1 align="center">Weekly Search Extract</h1>
<UL>
<%
File dir = new File("/wls_domains/blwls001/config/blwls001/applications/BT_LOAD/extract/");

String[] children = dir.list();
if (children == null)
{
// Either dir does not exist or is not a directory
}
else
{
for (int i=0; i<children.length; i++)
{
// Get filename of file or directory
out.println("<LI><a href=http://launchpad.nat.bt.com:50350/BT_LOAD/extract/"+ children[i]+">"+ children[i]+"</LI>");
}
}
%>
</UL>
</body>
</HTML>

Thanks,
Kaushik
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!