• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem with getRealPath

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

I am using getRealPath in my application which is deployed in application server as war file.

getRealPath is returning null,So i am trying to use getResource here in lieu of getRealPath.

suggest me whether it is a correct approach or not?

and also is there any method to convert URL to String type.

Need Urgently.....

your Response will be much appreciated.

Thanks in advance.

Varma
 
Bartender
Posts: 6663
5
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The javadoc has a hint for your problem.

Let us know what you are trying to do. That will help us answer your question better
 
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Try this piece of code

request.getContextPath()+"/xxx/public_html/ YOUR CONTEXT DIR HERE");
 
Janardhan Mudduluru
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Deepak and chandra for your quick responses....

i have solved this issue by removing getRealPath from my code.....in lieu i did use getResourceAsStream method directly without invoving getRealPath mehtod in between.

I am using this code in FrameWorkManager plugin provided by struts.

Thanks again

yours Janardhan.
reply
    Bookmark Topic Watch Topic
  • New Topic