• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem with getRealPath

 
Janardhan Mudduluru
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • 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
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • 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
 
bhaskarvignesh chandra sekaran
Greenhorn
Posts: 17
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic