Spring
(Example) Disable spring security default login page
๋ฌธ์
spring security ๊ด๋ จ ๋ํดํธ ๋ก๊ทธ์ธ ํ์ด์ง ํ๋ฉด์ด ๊ณ์ ๋ธ
์์ธ
SecurityConfig ํด๋์ค๊ฐ Configuration์ผ๋ก ๋ฑ๋ก๋์ง ์์ ํ๋ก์ ํธ์์ ์ค์ ์ธ์์ ๋ชปํจ
ํด๊ฒฐ
@Configuration๊ณผ @EnableWebSecurity ์ด๋ ธํ ์ด์ ์ถ๊ฐ
์ฝ๋
reference
DB ์ปฌ๋ผ๋ช
์ underbar ์์ผ๋ฉด JPA ์ฟผ๋ฆฌ ์ธ์ ๋ชปํ๋ ๋ฌธ์
โ๏ธ ๋ฌธ์
mysql์ ๋ง์ถฐ ์นด๋ฉ ์ผ์ด์ค๋ก ์ปฌ๋ผ๋ช ํต์ผํ๋๋ฐ(user_name),
DB ์ปฌ๋ผ๋ช ์ ์ธ๋์ค์ฝ์ด๊ฐ ์์ ๊ฒฝ์ฐ findByUser_name(ํน์ findByUserName) ๋ชป์
๐๐ป ํด๊ฒฐ
@Column์ต์ ์ ์ปฌ๋ผ ๋ค์์()์ ์ง์ ํด์ฃผ๊ณ , ํ๋ก๊ทธ๋จ ์์์๋
reference
java.lang.NullPointerExceptioin
Gradle's dependency cache may be corrupt
compileQuerydsl ์ค๋ฅ
reference
h2 console ์๋ณด์
BaseEntity null๊ฐ ๋ค์ด
์์ธ
JPA Auditing
ํด๊ฒฐ
์๋ ์ฝ๋ ์ถ๊ฐ
reference
Cannot deserialize value of type java.time.LocalDateTime
from String
java.time.LocalDateTime
from StringQuerydsl setting error
๋ฐฐ๊ฒฝ
๊ฒ์ ์ฒ๋ฆฌ๋ฅผ ํตํ ๋ฐ์ดํฐ๋ฅผ ๊ฐ์ ธ์ค๊ธฐ ์ํด QueryDSL ํ๋ ์์ํฌ ์ ์ฉ
๋ฌธ์
build.gradle์ dependencies์ ์ถ๊ฐํ๊ณ ์คํ์ค
Unable to load class 'com.mysema.codegen.model.Type'
. ๋ธ
์์ธ
QueryDsl์ ๊ธฐ์กด dependency๋ค์ ์ถ๊ฐํ๋ ๊ฒฝ์ฐ์ ๋ค๋ฅด๊ฒ ์ค์ ํ์ผ๋ค์ ์ถ๊ฐํด์ฃผ์ด์ผ ํ์ .. ใ
ํด๊ฒฐ
reference
Querydsl cannot find symbol ์๋ฌ
๋ฌธ์
Q class ์์ฒด๊ฐ ์์ฑ์ด ์๋๊ณ , ๋น๋ํ ๋ ๋น์ฐํ Q class ์ฐธ์กฐ ๋ชปํจ
์์ธ
JWT util ํ์ผ(repository ์ธ์ ์ฝ๋)์์ ์ค๋ฅ๊ฐ ์๊ฒจ ๋น๋ํ ๋ Q class ์์ฑ์ด ์๋จ
ํด๊ฒฐ
๋ฒ๊ทธ ์๋ ๋ถ๋ถ์ ํด๊ฒฐ ํ๊ณ ๋ค์ ๋น๋ํ๋ Q class ์์ฑ !!!
reference
Table 'DBNAME.TableName' doesn't exist.
ERROR 1074 (42000) at line 3: Column length too big for column 'txt' (max = 21845); use BLOB or TEXT instead
์์ธ
์ปฌ๋ผ value ๋๋ฌด ์ปค์ ๋ชป๋ค์ด๊ฐ
ํด๊ฒฐ
column value ์ค์ฌ์ฃผ๋๊น ๋ค์ด๊ฐ
reference
Request method 'POST' not supported
[org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'POST' not supported]
์์ธ
postman์์ requestbody ๋ณด๋ผ๋, ์ฒ์์ row์์ application type์ด text๋ก ๋์ด์์์
ํด๊ฒฐ
json์ผ๋ก ๋ฐ๊ฟ์ค
์ฃผ์
๊ฐ๋ postman์์ url ์ฃผ์๋ ๋ฉ์๋ ์๋ชป๋งค์นํด์ 404? ๋ธ ! ใ ใ ์ฃผ์์ฃผ์
What is the difference between @Controller and @RestController
Spring์์ ์ปจํธ๋กค๋ฌ๋ฅผ ์ง์ ํด์ฃผ๊ธฐ ์ํ ์ด๋ ธํ ์ด์ ์ @Controller์ @RestController๊ฐ ์์ต๋๋ค. ์ ํต์ ์ธ Spring MVC์ ์ปจํธ๋กค๋ฌ์ธ @Controller์ Restuful ์น์๋น์ค์ ์ปจํธ๋กค๋ฌ์ธ @RestController์ ์ฃผ์ํ ์ฐจ์ด์ ์ HTTP Response Body๊ฐ ์์ฑ๋๋ ๋ฐฉ์์ ๋๋ค. ์ด๋ฒ์๋ 2๊ฐ์ง ์ด๋ ธํ ์ด์ ์ ์ฐจ์ด์ ์ฌ์ฉ๋ฒ์ ๋ํด ์์๋ณด๋๋ก ํ๊ฒ ์ต๋๋ค.
@RestController๋ @Controller์ @ResponseBody๊ฐ ์ถ๊ฐ๋ ๊ฒ์ ๋๋ค. ๋น์ฐํ๊ฒ๋ RestController์ ์ฃผ์ฉ๋๋ Json ํํ๋ก ๊ฐ์ฒด ๋ฐ์ดํฐ๋ฅผ ๋ฐํํ๋ ๊ฒ์ ๋๋ค. ์ต๊ทผ์ ๋ฐ์ดํฐ๋ฅผ ์๋ต์ผ๋ก ์ ๊ณตํ๋ REST API๋ฅผ ๊ฐ๋ฐํ ๋ ์ฃผ๋ก ์ฌ์ฉํ๋ฉฐ ๊ฐ์ฒด๋ฅผ ResponseEntity๋ก ๊ฐ์ธ์ ๋ฐํํฉ๋๋ค. ์ด๋ฌํ ์ด์ ๋ก ๋์ ๊ณผ์ ์ญ์ @Controller์ @ReponseBody๋ฅผ ๋ถ์ธ ๊ฒ๊ณผ ์๋ฒฝํ ๋์ผํฉ๋๋ค.
reference
์ ์ด๊ฑฐ pathch-< put?
Cannot determine value type from string
db update
reference
Access to DialectResolutionInfo be null when 'hibernate.dialect' not set
reference
java.lang.IllegalStateException: org.hibernate.TransientPropertyValueException: object references an unsaved transient instance - save the transient instance before flushing
Last updated