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

url reading problem  RSS feed

 
siraj baig
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a file in my web applicatoin.
I am taking it's url to read that file.
StringBuffer sb = request.getRequestURL();
I am reading the using: FileOutputStream(sb)

But here i am getting only single slash(/) in my url
http:/localhost:8080/test/file/
how can i replace double slash in http:/

Thanks
siRaj
 
Deepa Korecherla
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
use the substring ...and concate "/" to the URL.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66203
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or better yet, do some research to find out why it's wrong in the first place rather than applying a bandage after the fact.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!