Questions tagged [modelattribute]
315 questions
0
votes
1 answer
Spring: ModelAttribute doesn't get called
I have a controller used to display a list of project, but I cannot find why a @ModelAttribute method doesn't get called.
This is my controller:
@Controller(value = "projectListController")
@RequestMapping(value = "VIEW")
public class…

luandrea
- 301
- 2
- 8
0
votes
0 answers
Spring aop (custom param in ControllerAdvice & ModelAttribute)
I want to add custom param to ControllerAdvice and ModelAttribute method. Please see code below.
@Target( { ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface MyPage {
String param();
}
@Controller
public class…

Alexey
- 517
- 2
- 10
- 21
0
votes
1 answer
how to set @modelattribute boolean value inside html
the code shows below
the Users value from @Modelattribute is boolean an how to set this condition

Prasanth A R
- 4,046
- 9
- 48
- 76
0
votes
2 answers
JQuery AJAX strange behaviour with parameters (Spring's @ModelAttribute)
I'm trying to pass a Map< String, String> to Spring via Ajax using @ModelAttribute notation.
With IntelliJ's REST client, I just have to add the "infos[KEY]" param with value "VALUE" to get the corresponding key/value couple populated in the…
user2137101
0
votes
2 answers
What is the Scope of Bean declared in @ModelAttribute annotation
I have a table having 40 columns and one bean corresponding to that table. But on page I am displaying only 10 fields. When the page is rendered, by debugging, I can see the bean is getting populated by all fields from the table and I am adding it…

Jaikrat
- 1,124
- 3
- 24
- 45
0
votes
1 answer
Unable to populate modelAttribute in spring
I am unable to get the ModelAttribute for second request.
My first request is initForm() method I prepared Command object and able to display the command in jsp.
Through initForm() I am populating command and that command I want in editForm when I…

Shoaib Chikate
- 8,665
- 12
- 47
- 70
0
votes
1 answer
@ModelAttribute has no value when using with @RequestParam
I have a controller class which has below mapping and I'm trying to call this with ajax.
@RequestMapping(value = "/jobs", method = RequestMethod.POST, headers = "Accept=*/*")
@ResponseBody
public String associate(@ModelAttribute ("job") Job job,…

Coder
- 417
- 5
- 18
0
votes
2 answers
How to handle data from form in Spring MVC
I have jsp that show all posts in blog