Home > Back-end >  Request. GetSession (). GetServletContext () getRealPath (" ") for less than the problem o
Request. GetSession (). GetServletContext () getRealPath (" ") for less than the problem o

Time:01-25


Saw a lot of information on the net, all say can get to the path of the project, why I will appear the above situation? Daniel give advice or comments, please just a little, really appreciate!!

CodePudding user response:

 
String rootPath=this. GetClass (). GetResource ("/"). GetPath (). The replaceAll (" ^ \ \/", "");

CodePudding user response:

refer to the original poster incarnate the number of response:

Saw a lot of information on the net, all say can get to the path of the project, why I will appear the above situation? Daniel give advice or comments, please just a little, really appreciate!!

Thank you for your answer, but not a slash/backslash problem, my problem is that the path is not at all I the path of the project, always the path of the disk C,

CodePudding user response:

Excuse me, would you please tell me how you solved?
  • Related