This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have David & Dawn Griffiths on-line!
See this thread for details.
Win a copy of Head First Android this week in the Android 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 ...
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • Al Hobbs
  • salvin francis

Relative Context path issue in struts application

Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I have 2 projects -

1. ProjecttContent - {context path ---> /hardware/xl/abc/content}
|---------------- content.xml

and ProjectWeb - {context path ---> /hardware/xl/abc}
|-------------- JavaSource
| -------------- package
| ----------

Now, in i need to get content.xml file to do further operation which is in ProjectContent project.

In ------

I am getting contextpath from request. which returns /hardware/xl/abc since this java file is in ProjectWeb.

As content.xml is in ProjectContent, so appended /content to context path which is returned from request in ContentData.

i.e. request.getContextPath(); returns /hardware/xl/abc

BufferedInputStream bufferedInputStream = new BufferedInputStream(new FileInputStream(request.getContextPath()+"/content.xml"));

[3/30/11 21:53:06:328 IST] 0000003e SystemErrR \hardware\xl\abc\content\content.xml (The handle is invalid.)
[3/30/11 21:53:06:343 IST] 0000003e SystemErrR at Method)
[3/30/11 21:53:06:343 IST] 0000003e SystemErrR at<init>(

Please let me know how to get access to content.xml which is in ProjectContent from in ProjectWeb

    Bookmark Topic Watch Topic
  • New Topic