So I'm trying to redirect the entire url with a th:href, but it is adding characters that I don't want.
My current url is this
http://localhost:8080/viewCourse/post/5
And I'm trying to backtrack to the course the post was a part of, which is
http://localhost:8080/viewCourse/1
So currently this is what my html looks like
<a th:href="@{'/viewCourse/'(${post.course.id})}"><span th:text="${post.course.name}"></span></a>
And this is the url I get
http://localhost:8080/viewCourse/?1
And the Id is correct, but I'm not sure why the ?
is there.
I've also tried this
<a th:href="@{'/viewCourse/'(id=${post.course.id})}"><span th:text="${post.course.name}"></span></a>
Which gives me this
http://localhost:8080/viewCourse/?id=1
If anybody can see how I can fix this and let me know that would be great, thanks in advance.