Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

i want to remove the hard coding  RSS feed

 
dhanunjaya kumar
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am reading data from a file using jsp.

FileInputStream fin=new FileInputStream("c:/program files/tomcat/project/book1.txt");

i want to remove this path "C:/......." and i want to use relative path like "/book1.txt" it was not working.

Even i went for java.io.File.getPath();but i did not succeeded
i am getting the path upto "c:/program files/tomcat/bin"

can any one help on this
 
Jean-Francois Briere
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In your JSP page try something like:

Regards
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!