This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 日付欄に空白を許可 | |
// https://stackoverflow.com/questions/4806033/converting-empty-string-to-null-date-object-with-spring | |
@InitBinder | |
public void initBinder(WebDataBinder binder) { | |
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd"); | |
dateFormat.setLenient(false); | |
binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JSP/JSTL (よくまとまってる) | |
http://struts.wasureppoi.com/jstl/00_jstl.html | |
Spring Framework (ver4) | |
https://docs.spring.io/spring/docs/4.3.13.RELEASE/spring-framework-reference/htmlsingle/ | |
Spring Security | |
https://docs.spring.io/spring-security/site/docs/4.2.3.RELEASE/reference/htmlsingle/ | |
Validator 関連 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
あってるかどうか知らん | |
stackoverflow かどこかで見つけたやつ? | |
空欄のときに validation をスキップさせたい時に使った。 | |
@InitBinder | |
public void initBinder(WebDataBinder binder) { | |
// 入力値が空の場合は null をセットしてバリデータをスキップする | |
binder.registerCustomEditor(String.class, "field_name", new StringTrimmerEditor(true)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
考え方(私見) | |
Javascriptを多用するページには合わないかもしれないが。。。 | |
作成、表示、更新、削除(CRUD) | |
URL | |
http[s]://なんたらかんたら/id | |
GET http[s]://なんたらかんたら/new | |
GET http[s]://なんたらかんたら/id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://stackoverflow.com/questions/2751603/how-to-get-error-text-in-controller-from-bindingresult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class 何かのクラス implements xxxAware { | |
public static 型 なんちゃらメソッド(); | |
} | |
xxx には ApplicationContext / Environment / MessageSource など |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import requests | |
import csv | |
# list | |
r = requests.get('https://www.mizuhobank.co.jp/retail/takarakuji/loto/loto6/csv/loto6.csv') | |
r.encoding='cp932' | |
loto6_list = [i[1:5] for i in r.text.splitlines() if i.startswith('第')] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import requests | |
import csv | |
# list | |
r = requests.get('https://www.mizuhobank.co.jp/retail/takarakuji/loto/loto6/csv/loto6.csv') | |
r.encoding='cp932' | |
loto6_list = [i[1:5] for i in r.text.splitlines() if i.startswith('第')] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
さくらのレンタルサーバーに python3.6 をインストールする方法 | |
=================================================== | |
そのままコンパイルすると pip が使えない(SSLバージョンエラー?)ので、openssl を入れる。 | |
openssl のコンパイル | |
---------------------------------- | |
wget https://www.openssl.org/source/openssl-1.0.2o.tar.gz | |
tar xvf openssl-1.0.2o.tar.gz | |
cd openssl-1.0.2o |
OlderNewer