Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > Pro JSP
|
Pro JSP Advanced JSP coding questions. Beginning questions will be redirected to the Beginning JSP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro JSP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 8th, 2011, 11:38 AM
Authorized User
 
Join Date: Sep 2008
Posts: 56
Thanks: 0
Thanked 1 Time in 1 Post
Default how to read a folder outside the context

My current application setup is this

/usr/AppServer/CDev/Sections.ear/sectionSite/all-listings

I would like to read a folder thats in another location on the same box.


/usr/DiffServer/sectionSite/small-site/sports-news

from my JSP I'm doing
<%
currDir= new File("/usr/DiffServer/sectionSite/small-site/sports-news");
for (File dirItem : currDir.listFiles()) {
out.print("items "+dirItem.getName());
}
%>

Ofcourse I get a null pointer. What am I doing wrong and if its possible how do I get the list of files under /sports-news folder?





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get current location of folder or drive on right click on folder or drive Babusingh C# 2008 aka C# 3.0 1 January 20th, 2010 05:17 AM
Unable to set context in web.xml or context.xml. dchicks Apache Tomcat 1 March 7th, 2008 07:59 AM
App_Code folder shared on only 1 folder? rpeters83 ASP.NET 2.0 Professional 1 September 1st, 2006 10:53 PM
Read Files from Folder using "FileSystemObject" davekrunal46 VB How-To 1 December 10th, 2005 07:43 AM
Making a folder virtual folder on button click in CsharpHelp C# 0 October 26th, 2005 05:57 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.