#Spring Boot

29 messages · Page 1 of 1 (latest)

dry spire
#

Hello guys,

I have problem with add book method. I will put pictures of my controller, my service, and my console. When i try to save book to data base, in console give me this, but in db nothing happend.

modest pilotBOT
#

This post has been reserved for your question.

Hey @dry spire! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

meager spoke
#

Can you just post the relevant code snippets

dry spire
#

i can give you my git repo ?

meager spoke
#

Sure

dry spire
#

ok

meager spoke
#

But also how are you viewing the db?

#

With intellij's browser?

dry spire
#

i use workbench to check db

#

i know my whole project is a mess, i am sorry for that

meager spoke
#

Yeah I see nothing wrong here

#

Maybe your db view isn't refreshing?

#

Or your db isn't configured to the port you think?

dry spire
#

when i add author, my db show new author, but nothing happend when i add book

#

so i guess its not from workbench, i refresh it

#

its just with the 3 books from db init

#

and it dosent redirect me after successful adding a book

#

so i guess there is a problem with something

#

and i have redirect after successful adding a book

dry spire
#

btw in inspector it give me status code 302 for POST

#

is it normal to give me this status code

meager spoke
#

Yes, that's a redirect response

#

I guess just boot up your app in the debugger and set a breakpoint in the controller to see what's going wrong

dry spire
#

i do this, but never hit the breakpoint where is repo.save()

dry spire
#

i found my problem, my dto have null field, but this field is coming from option html, so how to take option with thymeleaf and map it to dto ?

dry spire
#

i fix it ty for your help, i am very greatful