简体   繁体   中英

Problem with paths accessing CSS with Spring and 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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM