Javascript 我的视图似乎没有看到我的css、js。我用的是弹簧靴和百里香
这是我的login.html文件(视图)Javascript 我的视图似乎没有看到我的css、js。我用的是弹簧靴和百里香,javascript,css,spring,spring-boot,thymeleaf,Javascript,Css,Spring,Spring Boot,Thymeleaf,这是我的login.html文件(视图) 登录页面 addEventListener(“加载”,函数(){setTimeout(hideURLbar,0);},false);函数hideURLbar(){window.scrollTo(0,1);} 用户名错误 密码错误 记得我吗 在这个login.html中,我使用thymeleaf引用css、js和图像 下面是我的pom.xml <?xml version="1.0" encoding="UTF-8"?> <p
登录页面
addEventListener(“加载”,函数(){setTimeout(hideURLbar,0);},false);函数hideURLbar(){window.scrollTo(0,1);}
用户名错误
密码错误
记得我吗
在这个login.html中,我使用thymeleaf引用css、js和图像
下面是我的pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.social.manager</groupId>
<artifactId>Social-Manager</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>SocialManagement</name>
<description>Social Management App</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.2.5.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-social-facebook</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-social-linkedin</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-social-twitter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
4.0.0
com.social.manager
社会经理
0.0.1-快照
战争
社会管理
社会管理应用程序
org.springframework.boot
spring启动程序父级
1.2.5.1发布
UTF-8
1.8
org.springframework.boot
弹簧启动机aop
org.springframework.boot
spring引导启动器数据jpa
org.springframework.boot
弹簧启动安全
org.springframework.boot
SpringBootStarter社交facebook
org.springframework.boot
SpringBootStarter社交linkedin
org.springframework.boot
SpringBootStarter社交推特
org.springframework.boot
弹簧启动装置
org.springframework.boot
SpringBootStarterWeb
mysql
mysql连接器java
运行时
org.springframework.boot
弹簧启动机tomcat
假如
org.springframework.boot
弹簧起动试验
测试
org.springframework.boot
springbootmaven插件
我需要帮助,我已经浏览了关于这个主题的其他帖子,但它们似乎都不起作用
我的css文件放在src/main/resources/public下
src/main/resources/public/css
src/main/resources/public/js
src/main/resources/public/images
我的模板文件位于:
src/main/resources/templates如果没有处理这些路径的资源处理程序,
@{/css/style.css}
将获得源代码的src/main/webapp/css/style.css
中的文件;它与最终war包的文件夹结构不同
默认的maven war打包配置将
src/main/resources
内容放入WEB-INF/classes/
如果没有处理这些路径的资源处理程序,@{/css/style.css}
将获得源代码src/main/webapp/css/style.css
中的文件;它与最终war包的文件夹结构不同
默认的maven war打包配置将src/main/resources
内容放入WEB-INF/classes/
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.social.manager</groupId>
<artifactId>Social-Manager</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>SocialManagement</name>
<description>Social Management App</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.2.5.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-social-facebook</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-social-linkedin</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-social-twitter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>