NI-Lab.

nilog:

← 前の日 2018-12-31 次の日 →
← 一年前 一年後 →
Twitter (2018-12-31)
error の View を追加しろって書いてあるから、これが error.html を置けってことなのかな。わからん。。。

"error view that renders the same data in HTML format (to customize it, add a View that resolves to error)."

28. Developing Web Applications https://docs.spring.io/spring-boot/docs/2.1.0.RELEASE/reference/html/boot-features-developing-web-applications.html#boot-features-error-handling
[t] 2018-12-31 14:53:44
関連するかも情報
公式が提供しているサンプルコードには src/main/resources/templates/error.html が見つかった。

spring-boot/error.html at master · spring-projects/spring-boot · GitHub https://github.com/spring-projects/spring-boot/blob/master/spring-boot-samples/spring-boot-sample-web-secure/src/main/resources/templates/error.html
[t] 2018-12-31 14:43:24
error の View を追加しろって書いてあるから、これが error.html を置けってことなのかな。わからん。。。

"error view that renders the same data in HTML format (to customize it, add a View that resolves to error)."

28. Developing Web Applications https://docs.spring.io/spring-boot/docs/2.1.0.RELEASE/reference/html/boot-features-developing-web-applications.html#boot-features-error-handling
[t] 2018-12-31 14:53:44
"In the demo application this view maps in turn to the error.html Thymeleaf template. (If using JSP, it would map to error.jsp according to the setup of your InternalResourceViewResolver)."

Exception Handling in Spring MVC https://spring.io/blog/2013/11/01/exception-handling-in-spring-mvc
[t] 2018-12-31 14:56:00
結局、頼りになるのはドキュメントではなくサンプルコードってことかな。ドキュメントを探しても解決策が見つけにくいのなら、コピペコードが増えるのもしょうがないな。
[t] 2018-12-31 14:58:32
"htmlEscape(java.lang.String input, java.lang.String encoding)"

"Turn special characters into HTML character references."

HtmlUtils (Spring Framework 5.1.3.RELEASE API) https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/util/HtmlUtils.html
[t] 2018-12-31 15:03:30
HtmlCharacterEntityReferences#convertToReference

spring-framework/HtmlUtils.java at master · spring-projects/spring-framework · GitHub https://github.com/spring-projects/spring-framework/blob/master/spring-web/src/main/java/org/springframework/web/util/HtmlUtils.java
[t] 2018-12-31 15:04:43
UTF- なエンコーディングだとHTML特別文字を普通に置換。それ以外だと if (character < 1000 || (character >= 8000 && character < 10000)) で別の処理。

spring-framework/HtmlCharacterEntityReferences.java at master · spring-projects/spring-framework · GitHub https://github.com/spring-projects/spring-framework/blob/master/spring-web/src/main/java/org/springframework/web/util/HtmlCharacterEntityReferences.java#L135
[t] 2018-12-31 15:07:56
【話題のキーワード】
1. アテナ
2. アンナチュラル
3. ユーステス
4. 探偵ナイトスクープ
5. クビラ
6. グラブル
7. 神風
8. ガブリエル
9. 桐光
10. 中堂
https://search.yahoo.co.jp/realtime #buzzbot
[t] 2018-12-31 15:10:02
「KotlinのStringクラスには replaceAll メソッドはありません」
「Javaの様に正規表現で変換するには、kotlin.text.RegexExtensions.ktクラスにある拡張関数 toRegex()メソッドを用いて」

Kotlinの型を知る ~前編~ - Qiita https://qiita.com/AAkira/items/16ae2e9c0f6073e0e983
[t] 2018-12-31 15:17:30
Kotlin の文法になかなか慣れないな。

add の代わりに += が使えるのはちょっといいなと思った。

MutableList - Kotlin Programming Language https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html
[t] 2018-12-31 15:25:35
RT @m_bird:
ネットリテラシーとやら、インターネット長い人は付いてて当たり前みたいな雰囲気出してるけど、相当に難しい。Google検索結果も雑なまとめ記事ばかり、amazonの商品レビューもあてにならなくなってきてる世界で、「このにおいは怪しい」っての、どうやって伝えるねん、って60過ぎた母前にして頭抱える
[t] 2018-12-31 15:49:21
RT @oqarakun:
@m_bird 「ネットリテラシーのある人」を集めて、ネット上のデータを怪しいものと怪しくないものに分けさせて、それを教師データとして機械学習させるということをしなければならない(うまくいくかはしらん)
[t] 2018-12-31 15:49:47
lsof コマンド

Linuxでプロセスが何のポート使っているかを調べる - Qiita https://qiita.com/sonoshou/items/cc2b740147ba1b8da1f3
[t] 2018-12-31 16:05:47
【話題のキーワード】
1. アンナチュラル
2. みりあ
3. 中堂
4. 探偵ナイトスクープ
5. 神風
6. ヨドバシカメラ
7. 秋商
8. 帝京長岡
9. 大津
10. 尚志
https://search.yahoo.co.jp/realtime #buzzbot
[t] 2018-12-31 16:10:02
Spring Boot でポート番号を変更する。

application properties の場合

server.port=${port:8080}

application.yml の場合

server:
port: 9000
[t] 2018-12-31 16:25:12
コマンドラインからでもポート番号を指定できる。

"Some people like to use (for example) --port=9000 instead of --server.port=9000 to set configuration properties on the command line."

77. Properties and Configuration https://docs.spring.io/spring-boot/docs/current/reference/html/howto-properties-and-configuration.html
[t] 2018-12-31 16:25:12
Sprin Boot で開発環境と本番環境のプロファイルを切り替える例。

$ java -jar hoge-0.0.1.jar --spring.profiles.active=prod

Spring Boot Reference Guide https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-profiles
[t] 2018-12-31 16:26:54
【話題のキーワード】
1. みりあ
2. アンナチュラル
3. 中堂
4. 尚志
5. 杏果
6. おげんさん
7. 幸楽苑
8. 大晦日
9. 年越しそば
10. 赤枝議員
https://search.yahoo.co.jp/realtime #buzzbot
[t] 2018-12-31 17:10:03
RT @ichikawa_zoo:
渋滞発生のメカニズム🚗🚙🚚🚕
けっして前を行く者を煽ってはいけません🙅‍♂️年末年始、時間と気持ちに余裕をもってお出かけください🐹😅
#市川市動植物園 #モルモット #渋滞 #煽り運転 https://twitter.com/ichikawa_zoo/status/1079595302099669000/video/1
[t] 2018-12-31 17:33:06
年越しそば。天ぷらで埋まってるな(;´∀`) https://twitter.com/nilab/status/1079662530446782465/photo/1
年越しそば。天ぷらで埋まってるな(;´∀`)
元の画像を見る
[t] 2018-12-31 17:56:21
2018年12年31日のnilogをすべて表示する

- NI-Lab.
- Mastodon (@nilab@mastodon-japan.net)
- Twitter (@nilab)
- Timelog (@nilab)
- はてなブックマーク (id:nilab)

Web Services by Yahoo! JAPAN