So this application should be really simple, but for some reasons it is not working this simple CRUD, which "Passagens" (tickets) hava a onetoone relationship with aeroportos(airports) whtich is fine, but then when i move on to the front i created a dropdown and foreach to list all the airports and select the name of the correspondent airport and the id, when i finally move to the front it says that some of the values arent' being completed cuz they are all not nullable. BUT I CHECKED SOO MUCH, i think the issue is how do I pick the foreign of airports in the front and insert in the table of passagens(tickets) THE OTHERS TABLES ARE WORKING JUST FINEEE! AND CRUD ARE WORKING FOR THEM!
#SPRING BOOT
146 messages · Page 1 of 1 (latest)
⌛ This post has been reserved for your question.
Hey @fast dew! Please use
/closeor theClose Postbutton above when your problem is solved. 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.
Can you set a breakpoint in the cadastrar method?
in the controller
and check the content of the Passagens model attribute
maybe one of these dates is null?
yes
It looks like you are having issues with debugging or issues that can be solved using a debugger.
Check out this article on dev.java to see how debugging works and how to use a debugger.
This Stack Overflow question and its answers also explain debugging in general.
These links describe how to use the debugger in some IDEs:
• Debugging in IntelliJ
• Debugging in Eclipse
if you need help with it
ohhh thanks let me see i know how to set the breakpoint and trigger but idk how to enter springboot eclipse in debug mode
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
let me read
Disclaimer: I was a slightly involved in the creation/review of the dev.java article
you can start the application in debug mode by using the bug symbol
normally there's a green play button for running the application
find it!!!
now is launching hehee lets see
if it's started in debug mode, it will stop at breakpoints
but the sites linked here explain debugging both in general and in Eclipse specifically
on the right in the variables view, you can see your variables
specifically passagem
Is that as you expect it?
the id values are fine
and it actuallys show the airport id right?
soo maybe
the problem it is the date
what is the chegada thing?
oh date of returning
is it null?
perfect
all three are null
you GOT IT
all three dates null
but preco(price) is working just fine
the error tells you "it tried to put a non nullable field (the chefeda thing) into the database but it was null
?
what is jackson
mport java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.format.annotation.DateTimeFormat.ISO;
since these are typically sent as strings
ah ok that looks ok
Can you check the network tab of the browser window while you make the request
you the boss let me do it
browser devtools*
the network tab shows you exactly what is being sent
that should match what the Spring application receives
click on it
btw you can press F8 in Eclipse and it will continue
like the breakpoint suspends the program
and F8 lets it continue
?
reload and see the network?
that one looks like you might have reloaded the page by clicking in the URL bar and pressing enter or similar
Do you know the difference between GET and POST?
lil bit get
i can just receive the value cannot change it
post and can change the entire thing
?
like for instance i can get the id
the network tab should show you what's sent
but i cant change the id in GET
ah so the browser can do GET and POST requests
typically, you'd use GET for anything requesting a page and POST for operations that change something
what's in the payload part?
or the other parts there
these might give you information about the request
nop
I think you should use th:field for your thymeleaf fields
.
in the inputs
but like for creating the value should be "" right?
?
idk
I guess
you could also try enabling verbose logging
ooh what is this
to get more information
it means print more stuff to the console
whenever something happens
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use/help ping.
Warning: abusing this will result in moderative actions taken against you.
maybe the issue is the variables being multiple words
possible
but in general, I would try to use LocalDate or LocalDateTime if possible
Thanks soo much for you helping tho
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.