質問編集履歴

2

起動方法の追加

2020/01/29 12:30

投稿

takahiro00
takahiro00

スコア84

test CHANGED
File without changes
test CHANGED
@@ -87,3 +87,15 @@
87
87
  }
88
88
 
89
89
  ```
90
+
91
+ アプリの起動方法は以下のようにserviceにして起動しています。
92
+
93
+ [root@test]# sudo cp taisyou.jar /var/myapp/
94
+
95
+ [root@test]# chmod 500 /var/myapp/taisyou.jar
96
+
97
+ [root@test]# sudo ln -s /var/myapp/taisyou.jar /etc/init.d/myapp
98
+
99
+ [root@test]# sudo chkconfig --add myapp
100
+
101
+ [root@test]# sudo chkconfig myapp on

1

追記

2020/01/29 12:30

投稿

takahiro00
takahiro00

スコア84

test CHANGED
File without changes
test CHANGED
@@ -47,3 +47,43 @@
47
47
  サーバー:CentOS
48
48
 
49
49
  SpringBoot 2.0
50
+
51
+
52
+
53
+ 追記
54
+
55
+ 以下のWebMvcConfigを追加したのですが、うまくいかず、、
56
+
57
+ ```java
58
+
59
+ package com.kproject02.controller;
60
+
61
+
62
+
63
+ import org.springframework.context.annotation.Configuration;
64
+
65
+ import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
66
+
67
+ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
68
+
69
+
70
+
71
+ @Configuration
72
+
73
+ public class WebMvcConfig extends WebMvcConfigurerAdapter {
74
+
75
+ // ...
76
+
77
+ @Override
78
+
79
+ public void addResourceHandlers(ResourceHandlerRegistry registry) {
80
+
81
+ registry.addResourceHandler("/static/**")
82
+
83
+ .addResourceLocations("classpath:/static/");
84
+
85
+ }
86
+
87
+ }
88
+
89
+ ```