英文:
Problem with paths accessing CSS with Spring and Apache FreeMarker
问题
我在尝试从较低的目录访问静态CSS资源时遇到了问题。如果我在主目录中,它可以检测到一切,但如果我进入其他较低的目录,它会添加从那个文件夹的路径,并且无法检测到它们。
错误
(在该路径中,“server”是不应出现的目录,因为css位于主目录中)
<link rel="stylesheet" href="/css/bootstrap.min.css">
<!-- Bootstrap CSS
============================================ -->
<link rel="stylesheet" href="/css/font-awesome.min.css">
我尝试过使用../、./等方式,搜索了互联网,但没有找到任何有用的信息。
我正在使用Apache FreeMarker。
英文:
I'm having a problem trying to access my static CSS resources from lower directories. If I am in the main directory it detects everything but if I go to other lower directories, it adds the path from that folder and does not detect them.
Error
(In that path "server" is a directory that should not appear, since css is in the main directory)
<link rel="stylesheet" href="/css/bootstrap.min.css">
<!-- Bootstrap CSS
============================================ -->
<link rel="stylesheet" href="/css/font-awesome.min.css">
I tried from putting ../, ./ searching the internet but I didn't find anything.
I am using Apache FreeMarker
答案1
得分: 0
Use ..
to indicate the parent directory:
<link rel="stylesheet" href="../css/bootstrap.min.css">
<link rel="stylesheet" href="../css/font-awesome.min.css">
This will help you.
英文:
Use ..
to indicate the parent directory:
<link rel="stylesheet" href="../css/bootstrap.min.css">
<link rel="stylesheet" href="../css/font-awesome.min.css">
This will help you.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论