NutzCN Logo
问答 使用undertow 但是找图片的路径和我要的不一样
发布于 2213天前 作者 llpmumu 2162 次浏览 复制 上一个帖子 下一个帖子
标签:
server.port=8080
server.host=0.0.0.0

undertow.port=8088
undertow.host=0.0.0.0
undertow.staticPath=E:\

使用 undertow.port=80的时候会报404错误
请求的 URL http://localhost:80/image/1523374653580.jpg
物理路径 C:\inetpub\wwwroot\image\1523374653580.jpg

使用 undertow.port=8088的时候会提示not Found

7 回复

那你为啥写个E:呢

undertow.staticPath=C:/inetpub/wwwroot/

来自炫酷的 NutzCN

可是我的图片到时候会存在E盘 所以想从E盘读取

今天早上又试了一下 一开始可以 但是到后面图片又提示not found

。。。 有点乱,图片到底在哪里

配置信息在部署的时候可以改的啊。。。

我把图片放在E://image/下面
运行会提示not fount
但是我设置了

undertow.port=80
undertow.host=0.0.0.0
undertow.staticPath=E:\

不知道为什么没有生效

结果无论有没有出来图片控制台都会提示

[DEBUG] 14:14:04.158 io.undertow.util.PathMatcher.match(PathMatcher.java:97) - Matched default handler path /image/2018041311320010724.jpg
[DEBUG] 14:14:04.986 io.undertow.util.PathMatcher.match(PathMatcher.java:97) - Matched default handler path /image/2018041311320010724.jpg
[DEBUG] 14:14:05.170 io.undertow.util.PathMatcher.match(PathMatcher.java:97) - Matched default handler path /image/2018041311320010724.jpg
[DEBUG] 14:14:05.417 io.undertow.util.PathMatcher.match(PathMatcher.java:97) - Matched default handler path /image/2018041311320010724.jpg
[DEBUG] 14:14:05.593 io.undertow.util.PathMatcher.match(PathMatcher.java:97) - Matched default handler path /image/2018041311320010724.jpg

斜杠改成反斜杠

谢谢 可以了 好奇的是为什么我在另外一台电脑上用\这个斜杠可以使用

添加回复
请先登陆
回到顶部