public java.net.URL getResource(String name)获取到的路径乱码

解决办法:

String absolutePath = StaticResourceUtil.class.getResource("/").getPath();
absolutePath = URLDecoder.decode(absolutePath, "utf-8");

进行解码就可以了。

posted on 2024-05-31 14:34  ~码铃薯~  阅读(19)  评论(0)    收藏  举报

导航