Size: a a a

Spring Framework and more

2020 June 08

m

maks in Spring Framework and more
Lionel Lawrence
I'm getting this error. I included a controller java file in my controller folder. The main class is outside the controller, moder, Service and repository layer folders. It is able to recognise the new controller java file which I added
Hi. Please check whether your controller class has appropriate annotation and configured endpoint
источник

LL

Lionel Lawrence in Spring Framework and more
maks
Hi. Please check whether your controller class has appropriate annotation and configured endpoint
No message available denotes that the request mapping in the controller and in the HTML tsmplate doesnt match right?
источник

m

maks in Spring Framework and more
Well, it migth be. It depends on your implementation. Could you give more context? Example of your controller class will be helpful
источник

LL

Lionel Lawrence in Spring Framework and more
Yes i have made a spell error
источник

LL

Lionel Lawrence in Spring Framework and more
источник

LL

Lionel Lawrence in Spring Framework and more
Required string Parameter is not present suggests I've made some error in declaring the request param?2
источник

LL

Lionel Lawrence in Spring Framework and more
? *
источник

m

maks in Spring Framework and more
Yeah.  It says parameter. But you provide comments as url path. Try image/9/dfdf?comments
источник

m

maks in Spring Framework and more
Btw your resource url looks weird
источник

m

maks in Spring Framework and more
After comments should be equals sign and some value. For example dfdf?comments=value
источник

LL

Lionel Lawrence in Spring Framework and more
maks
Yeah.  It says parameter. But you provide comments as url path. Try image/9/dfdf?comments
No😂 I just gave a random title🥶
источник

LL

Lionel Lawrence in Spring Framework and more
maks
After comments should be equals sign and some value. For example dfdf?comments=value
Image/imageid/title/comments
источник

LL

Lionel Lawrence in Spring Framework and more
After typing in comments, clicking the submit button is causing this problem. The comments which im typing in is not recognised
источник

LL

Lionel Lawrence in Spring Framework and more
maks
After comments should be equals sign and some value. For example dfdf?comments=value
Comments =value? Do I need to change the request param argument?
источник

LL

Lionel Lawrence in Spring Framework and more
Controller

@RequestMapping(value = "/image/{imageId}/{imageTitle}/comments", method = RequestMethod.POST)
   public String newComment(@PathVariable("imageId") Integer imageId, @PathVariable("imageTitle") String title, @RequestParam("comments") String text, HttpSession session)


Html

th:action="'/image/'+ ${image.id} + '/' + ${image.title} + '/comments'">
источник

m

maks in Spring Framework and more
Ok,let's see
источник

m

maks in Spring Framework and more
I guess. I was right.  In controller there's a request param comments of String type. I don't see you provide it in html
источник

m

maks in Spring Framework and more
Or it's not html  whatever
источник

LL

Lionel Lawrence in Spring Framework and more
The id provided in the HTML should be comments as well?
источник

m

maks in Spring Framework and more
th:action="'/image/'+ ${image.id} + '/' + ${image.title} + '?comments=firstcomment'">
источник