Questions tagged [modelattribute]
315 questions
0
votes
2 answers
@ModelAttribute execution before displaying the JSP
I have defined @ModelAttribute in my controller, which needs to be excuted based on the requested methods output. So when I trying to accessing the my ModelAttribute from JSP, but it is producing the previous result. For example below:
class…

DeepVeen
- 299
- 1
- 5
- 14
0
votes
1 answer
Check For Modal Attribute Existence In Controller Method before adding
I have a spring controller that I want a method to handle a certain request and then redirect to another one with keeping some value attached, so I will use RedirectAttributes on the first one and @ModalAttribute on the second, but the thing is I…

engma
- 1,849
- 2
- 26
- 55
0
votes
2 answers
Assigning attributes in HTML form or when calling .new(*attrs)
I have worked on numerous projects where I have seen both the setting of attributes for a new object in an HTML form and when calling Model.new(foo: 'bar')
Which is the correct way of doing this in the fashion of "best practices"?
Form:
<%= form_for…

dennismonsewicz
- 25,132
- 33
- 116
- 189
0
votes
1 answer
usege of uploadify in a spring webflow flow
this is my first question here so please point me to right direction if i do something wrong.
i'm experiencing some difficulties while trying to use uploadify flash based multi file uploader inside a spring webflow flow. here is a detailed…

mtorak
- 21
- 5
0
votes
0 answers
What should be the value of @ModelAttribute when handling POST in Spring MVC?
I'm learning Spring MVC with the tutorial of the site here
My question is basically in the code fragment bellow.
@RequestMapping(value = "/addContact", method = RequestMethod.POST)
public String addContact(@ModelAttribute("contact")
…

TwilightSun
- 2,275
- 2
- 18
- 27
0
votes
1 answer
In MVC type.GetProperties().ElementAt(1).CustomAttributes returning 0
In MVC 4, I have created a ADO.NET Entity Data Model (using Database First Approach) and then added a class in the project to add custom attributes like DisplayAttribute or DataTypeAttribute.
Example…

Vishal Thakur
- 3
- 2
0
votes
2 answers
Using ModelAttrbute annotation to submit object from jsp to controller
I'm using spring mvc 3.1.0 with jsp/jstl.
To submit object to my controller I'm using the ModelAttribute annotation and all is working fine.
But, when I try to submit a complex object to my controller his value is null.
This is my object…

Mouhie
- 59
- 2
- 3
- 16
0
votes
1 answer
Submit complexe object to controller using @ModelAttribute with spring mvc
im using spring mvc 3.1.0 with jsp/jstl
Please, how to use conversion with @ModelAttribute in spring mvc
i want to submit an object from my jsp page to the controller, my object contains a select tag of an object field in my class who is always…

Mouhie
- 59
- 2
- 3
- 16
0
votes
2 answers
Spring MVC null attribute in my @modelAttribute object sended to the controller
I'm trying to use @modelAttribute to send my model attributes to the controller
my model contains many attributes (String, Integer,..) one of them is an object that i want to retrieve from a select tag.
the problem is when i pass the modelattribute…

Mouhie
- 59
- 2
- 3
- 16
0
votes
0 answers
How to delete a Spring MVC model attribute in JSP
I am setting a model attribute in controller like
@RequestMapping(value = {"/searchMessage.htm" }, method = RequestMethod.GET)
public String searchMessage(Model model, HttpServletRequest request) throws CoreException {
if…

SDC
- 161
- 1
- 11
0
votes
1 answer
Spring MVC @modelattribute in proxied controller
I have a controller which has an interface as proxy
@Controller
public class MyController implements IMyController{
public FormBean getCommand(){
return new FormBean();
}
public String onLoad(HttpServletRequest…

Srini
- 420
- 1
- 5
- 17
0
votes
1 answer
page cannot load, BindingResult nor plain target object for bean name ' ' available as request attribute"
"Neither BindingResult nor plain target object for bean name 'relationForm' available as request attribute"
I have some issues with the error above, I'll post the important part of the code right here.
Any idea that you guys have is appreciated
The…

EmilOoo
- 3
- 5
0
votes
1 answer
How to dynamically assign a value to the commandName attribute in tag of spring
I want to dynamically add a string value to the commandName attribute using the following JSTL code.
add_item
update_item
…

h-rai
- 3,636
- 6
- 52
- 76
0
votes
1 answer
Spring mvc, fileds not in form will get cleared because of null value
I have a simple POJO:
@Document(collection = "questions")
public class Question {
private String title;
private Date createdAt;
//..... all the getter and setters
}
I did not add the createdAt on the edit form, because it should not…

Ark Xu
- 111
- 1
- 4
0
votes
1 answer
Spring MVC - Model Attribute parameter not refreshing on GET
I've got a SpringController getting a RequestParameter named 'start' for search/hibernate pagination purposes. If the parameter is null, just start from zero and render a JSP with a JavaScript var 'start = {start + 10}', so if the user clicks on the…

Azurlake
- 612
- 1
- 6
- 29