RequestParam / User Not Found
Hello again guys,
I'd like to render my data user on a template with the GET method. I made sure my page was created and my datas are persisted in my db.
I tried to render my data through the email user as it's shown below and I want my URL to be like this :
http://localhost:8080/[email protected]
( which works perfectly if I write this in my browser bar ) but when I want to access to my profile it return me a USer nto found, because Spring boot sees it as null
12 Replies
⌛
This post has been reserved for your question.
Hey @NoSung! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
💤
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.
Does it work if you use
@RequestParam(required = false, name = "email")
? The the javac-compiler miss the -parameter
flag. See https://docs.oracle.com/en/java/javase/17/docs/specs/man/javac.html💤
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.
Unfortunately, I have tried this one, but it didn't work, it's seen as null
What have you tried? The modification of the Annotation or the -parameter flag?
The
@RequestParam(required = false, name = "email")
. I'm currently looking for an article about retrieving my query parameter but I still didn't find the solution.
But as I said, oddly I can get my mail if I write the whole query in my URL http://localhost:8080/[email protected]
like this, then it returns the data I wantBut you can not get the email when you access your profile, right?
Well actually, I didn't build anything yet in my profile page but when I write the whole URL, it returns me the name but when I click to access to the profile page it doesn't
I do not get it. Do you have a profile-page or not?
Hm, there might be a corner-case where
https://localhost:8080/[email protected]
might be parsed as
Domain: https://test.com
using the username localhost
and
the password 8080/profile?email=test
.
But this might not explain an request to the server without email-parameter
Could you try to urlencode the @
?I have it but when I click on the profile page it returns me a user not found because the param query is null
Wait we need to urlencode the special characters ?
Wait no on this one I think you're wrong because if it wasn't encoded, I couldn't even get a status 200 from my URL as I showed you above
💤
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.
💤
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.