**
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<targetPath>WEB-INF</targetPath>
<includes>
<include>**/*.*</include>
</includes>
</resource>
<resource>
<directory>src/main/webapp</directory>
<targetPath>WEB-INF</targetPath>
<includes>
<include>**/*.*</include>
</includes>
</resource>
</resources>
<finalName>boot</finalName>
</build>**
<packaging>war</packaging>
就是一个简单的工程,想给login.jsp 里面字体加个红颜色,css在springboot的static中,在resources里面。
关键是打包后,在tomcat的 webapps里面解压,路径根本就乱的,文件夹套着文件夹,一层一层的,css根本就深的找不到路径。所以
http://localhost:8080/boot/pages/login.jsp 字体找不到样式表。
疑问:
最好是 war包解压后是 boot/pages boot/static/layout.css 这样的结构,
哪位大神,如果云游此地,但愿不吝赐教,顺便用法眼看看。
最好是看了解决掉的。不能复制别的地址过来。来解决这个问题哦。。。
大佬,boot是你的项目名,进来以后你能看到你的静态文件和web-inf,web-inf放的是编译文件。机器只能识别.class。不能识别.java,真正有用的是.class。所以要编译。所以当你打好war包,tomcat一启动,就会编译,生成你现在看到的目录文件层次。更配置文件没关系。我是这样理解的,应该是对的。你如果是前端,想配置路径的话,往常怎么配就怎么配,不用改变