teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

画面遷移のエラーについて

2020/05/27 13:00

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
@@ -1,13 +1,13 @@
1
1
  ### 前提・実現したいこと
2
2
 
3
- SpringSecurityでログイン認証を行った後、トップ画面(top.html)に遷移できず、500のエラーが出てしまう。
3
+ SpringSecurityでログイン認証を行った後、トップ画面(top.html)から編集画面(edit)に遷移できず、500のエラーが出てしまう。
4
4
 
5
5
  ### 発生している問題・エラーメッセージ
6
6
 
7
7
  ```
8
- Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.thymeleaf.exceptions.TemplateInputException: An error happened during template parsing (template: "class path resource [templates/top.html]")] with root cause
8
+ Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.thymeleaf.exceptions.TemplateInputException: An error happened during template parsing (template: "class path resource [templates/edit.html]")] with root cause
9
9
  ```
10
- 一度ログインできていたのですが、loginUserをhtmlした辺りから急にエラーが出るようになりました。
10
+ 一度ログインできていたのですが、遷移先リンクをhtmlに追記した辺りから急にエラーが出るようになりました。
11
11
 
12
12
  ### 該当のソースコード
13
13
  各部関係していそうなところを抜粋しています。
@@ -50,6 +50,7 @@
50
50
  registry.addViewController("/signup").setViewName("signup");
51
51
  registry.addViewController("/top").setViewName("top");
52
52
  registry.addViewController("/").setViewName("top");
53
+        registry.addViewController("edit").setViewName("edit");
53
54
  }
54
55
  }
55
56
  ```
@@ -74,6 +75,7 @@
74
75
  </head>
75
76
  <body>
76
77
  <h1 th:inline>人材管理システム</h1>
78
+      <a th:href="@{/edit}">編集</a>
77
79
  <form th:action="@{/logout}" method="post">
78
80
  <input type="submit" value="ログアウト" />
79
81
  </form>
@@ -86,6 +88,7 @@
86
88
  MvcConfigのtopを設定している箇所とControllerのvalue値に/を入れたり入れなかったりしましたがうまくいかず。
87
89
  htmlで追記した部分もコメントアウトしてみましたが駄目でした。
88
90
  セッションが残っているのかとも思ったのですが、chromeのシークレットでもエラーとなります。
91
+ edit.htmlはtop.htmlのvalueの値が変わっているのみです。
89
92
 
90
93
  ### 補足情報(FW/ツールのバージョンなど)
91
94