赞
踩
目录
右侧maven Projects 里的小工具按钮,可以快速进入maven的配置界面
这里可以方便的更改各项配置
这里可以方便的打开settings.xml,把阿里云的maven镜像导入进去
- <mirror>
- <id>nexus-aliyun</id>
- <mirrorOf>*</mirrorOf>
- <name>Nexus aliyun</name>
- <url>https://maven.aliyun.com/repository/public</url>
- </mirror>
-
然后因为写上位机的开发突然有空对接口了,万般无奈下,还是默默的打开了尘封已久的项目,上网随便下了一个后台管理的模板,想要放到这个项目里,简单做个后台管理页面,呵呵,然后我真的是too young too simple。周二晚上开始,中间断断续续查,周五晚上才确实访问起来。
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-thymeleaf</artifactId>
- </dependency>
- <resource>
- <directory>src/main/resources</directory>
- <targetPath>META-INF/resources</targetPath>
- <includes>
- <include>**/**</include>
- </includes>
- </resource>
- @Controller
- public class PageController {
- @RequestMapping({"", "index"})
- public String index(Model model) {
- String data = "aaaaa啊啊啊";
- model.addAttribute("data", data);
- return "/index";
- }
- }
- protected SpringApplicationBuilder configure(
- SpringApplicationBuilder builder) {
- return builder.sources(Application.class);
- }
- @Controller
- public class PageController {
- @RequestMapping({"", "index"})
- public String index(Model model) {
- String data = "aaaaa啊啊啊";
- model.addAttribute("data", data);
- return "/index";
- }
- }
- #thymelea模板配置
- spring.thymeleaf.prefix=classpath:/templates
- spring.thymeleaf.suffix=.html
- spring.thymeleaf.mode=HTML
- spring.thymeleaf.encoding=UTF-8
- #热部署文件,页面不产生缓存,及时更新
- spring.thymeleaf.cache=false
- spring.resources.chain.strategy.content.enabled=true
- spring.resources.chain.strategy.content.paths=/**
<script src="../static/html/js/waves.js"></script>
<a class="waves-effect waves-dark" href="index" aria-expanded="false">
- @Override
- protected SpringApplicationBuilder configure(
- SpringApplicationBuilder builder) {
- return builder.sources(Application.class);
- }
- <groupId>com.example</groupId>
- <artifactId>springboot-demo</artifactId>
- <version>1.0.0</version>
- <packaging>war</packaging>
- <plugin>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-maven-plugin</artifactId>
- <configuration>
- <mainClass>com.zhili.platform.zhili_product.ProductApplication</mainClass>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>repackage</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <resource>
- <directory>src/main/resources</directory>
- <filtering>true</filtering>
- <includes>
- <include>**/*</include>
- </includes>
- </resource>
- <resource>
- <directory>src/main/resources</directory>
- <targetPath>META-INF/resources</targetPath>
- <includes>
- <include>**/**</include>
- </includes>
- </resource>
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。