使用springboot做项目css和js始终找不到

问题描述

问题出现的环境背景及自己尝试过哪些方法

相关代码

// 请把代码文本粘贴到下方(请勿用图片代替代码)
application.yml配置

spring:
  thymeleaf:
    cache: false
    prefix: classpath:/templates/
    suffix: .ftl
    encoding: utf-8
  datasource:
    driver-class-name: com.mysql.jdbc.Driver
    username: root
    password: 123456
    url: jdbc:mysql://localhost:3306/wxdcxt?useUnicode=true&characterEncoding=utf-8
  jpa:
    show-sql: true
  jackson:
    default-property-inclusion: non_null
  mvc:
    static-path-pattern: /static/**
server:
  servlet:
    context-path: /sell







#    相当于springmvc中/views中的 uri
#server:
#  servlet:
#    context-path: /apache-tomcat-7.0.90

add.ftl 部分代码

<!DOCTYPE html>
<html lang="en" >
<head>

    <meta charset="utf-8">
    <title>686 Adminize</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <!-- Le styles -->
    <link href="http://fonts.googleapis.com/css?family=Oxygen|Marck+Script" rel="stylesheet" type="text/css">
    <link href="/css/bootstrap.css" rel="stylesheet">
    <link href="./css/font-awesome.css" rel="stylesheet">
    <link href="../css/admin.css" rel="stylesheet">

    <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

项目目录如下
clipboard.png

你期待的结果是什么?实际看到的错误信息又是什么?

网上试了多种方法,始终找不到

阅读 6.7k
1 个回答
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题