エンジニア男

勉強したことの忘備録としてつらつら書いていきます。

Spring Boot

TomcatとPostgreSQLの連携

[PostgreSQL] ①postgresql.confの変更 ※IPアドレスの変更とポートの開放 vi /var/lib/pgsql/data/postgresql.conflisten_address = 'localhost'posrt = 5432 ②postgresql.service ※起動スクリプトでポート番号を確認 vi /usr/lib/systemd/system/postgresql.…

SpringBootでAJP通信を可能にする設定

SpringBootでAJP通信を行う際の設定 SpringBootの実行クラスの設定 @Configuration@SpringBootApplicationpublic class HelloWorldApplication extends SpringBootServletInitializer { public static void main(String[] args) { SpringApplication.run(Hel…

spring bootをwarにビルドする

Spring Bootのプロジェクトをwarにビルドする時の手順メモ pom.xmlの設定 <packaging>war</packaging>~~~<dependency> <groupId>org.springframework.boot</groupId> <artifactId></artifactId> <scope>provided</scope></dependency> ・<packaging>をwarに設定・spring-boot-starter-tomcatのscopeをprovidedに設定 →アプリケーションにtomcatを内蔵しない設定にするため SpringBoot…</packaging>

spring securityでRequestRejectedExceptionが発生した場合

※参考にさせて頂いたサイト https://docs.spring.io/spring-security/site/docs/5.0.0.RELEASE/reference/htmlsingle/#request-matching https://www.ietf.org/rfc/rfc2396.txt https://sun0range.com/information-technology/request-rejected-exception Sp…

ThymeleafのTips

th:xxx = "#{xxxx}" でi18n対応の文字列呼び出すことが出来る。 === // HTMLファイル内に書く<script th:inline="javascript">/*<![CDATA[*/ var mode = /* ${mode} */ //model内の値をjsへ var temp = /* #{xxxx} */ //i18n対応の文字列をjsへ/*]]>*/</script> サーバー側の値をjavascript側へ送る処…

SpringBoot で日本語を含むURLにリダイレクトすると、日本語が文字化けしてしまう場合の処理

・業務で日本語を含むURLにリダイレクトすると、日本語が文字化けしてしまうエラーの対応をしたので、その際のメモ。 参考にさせて頂いたサイト https://mike-neck.hatenadiary.com/entry/2018/01/04/073000 http://terasolunaorg.github.io/guideline/5.1.0…