Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

FileNotFoundException

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi pals

I have on application. in this application we are usig Maven and androMDA. O.K. in this application i have written one jsp page. the jsp page reading one file. the file reside same directory. after building the application, i opend console page. iam trying to get file results, there iam getting above exception...

where i have to put the file ?
in the same directory or any another?
my source code is resides in d:\malli\console\.....
my .ear file resides in d:\malli\jboss-4.0.0\server\deploy\..

where ia have to put my file?

Thanks
Mallikarjuna
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I bet you are using a method to open the file that depends on the "current directory" - in the JSP environment you have NO control over the current directory - there are specific methods to find files relative to the location of a web application. See for example getRealPath() and related methods in ServletContext class.

You can probably find recent discussions in the JSP and servlet forums.

Bill
 
permaculture is largely about replacing oil with people. And one tiny ad:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic