2024-07-12
한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina
प्रथमं सोपानं स्प्रिंगबूट् इत्यस्मिन् थाइमलीफ् टेम्पलेट् इञ्जिनस्य उपयोगः भवति
- <!-- thymeleaf 模板 -->
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-thymeleaf</artifactId>
- </dependency>
- spring:
- # 模板引擎
- thymeleaf:
- mode: HTML5
- encoding: utf-8
- # 禁用缓存
- cache: false
विन्यासे स्थिरसञ्चिकानां अभिगमनं सक्षमं कुर्वन्तु
- public class ResourceConfig implements WebMvcConfigurer {
- @Override
- public void addResourceHandlers(ResourceHandlerRegistry registry) {
- registry.addResourceHandler("/**").addResourceLocations("classpath:/static/");
- }
- }
npm run build
संकुलितानि स्थिरसञ्चिकाः स्थिरपुटे स्थापयन्तु, तथा च index.html टेम्पलेट्पुटे स्थापयन्तु
index.html पृष्ठं प्रति कूर्दतु
- @Controller
- @CrossOrigin
- public class IndexController {
- @GetMapping("/")
- public String index(){
- return "index";
- }
- }
पोर्ट् प्रविश्य तत्र प्रवेशं कुर्वन्तु!