Questions tagged [modelattribute]
315 questions
0
votes
2 answers
Spring Form hidden value is lost on submit
On my 'update user' page I have a hidden field to hold the ID of the current user being edited. I've checked the HTML source and the value populates correctly. However when I submit the form, the userID value ALWAYS comes through as 0 while every…

Felix
- 610
- 2
- 9
- 21
0
votes
1 answer
Spring : the 404 error only with the vo class as a parameter in spring controller
I'm making a site with Spring framework.
the problem is the 404 error occurs only when I put the VO as a parameter.
I put the VO as a @ModelAttribute in controller.
I made the VO's properties with two tables columns together.
I guess the problem is…

ROMM
- 15
- 7
0
votes
1 answer
Spring MVC 3.1 - Model Attribute lost
I have a quick question on scope of ModelAttributes.
Dev. Env: Spring MVC 3.1/Java 6/JSP w/JSTL for Views
In my controller, I add an attribute to the model via
model.addAttribute(“appForResubmission”, appForResubmission);
In the JSP(served out in…

M.R.
- 1
- 1
- 3
0
votes
1 answer
Spring MVC @ModelAttribute getting filled Entity
Today I am stuck with the spring-form with the POST method which doesn't give posted item to the Controller which I wanted. Here is my code.
Controller.java
@Controller
@RequestMapping("/cart")
public class CartController extends CommonController
{
…

Skyverian
- 53
- 1
- 1
- 7
0
votes
1 answer
Manually doing what the ModelAttribute annotation does in Spring MVC
I have an action method on a Spring MVC controller that has an argument annotated with @ModelAttribute. However, I don't know at compile time what the type of this parameter will be - I know the abstract base type but not the derived type.
At…

efdee
- 2,255
- 3
- 20
- 26
0
votes
0 answers
passing a modelAttribute to an AJAX method
I'm quite new using Spring and AJAX with JQuery, and I'm having some troubles with it.
I need to fill one combobox, depending the value of another combobox in the jsp. I need some values from the jsp bean, so I need to pass the bean to the Ajax…

elcadro
- 1,482
- 3
- 21
- 45
0
votes
1 answer
How to access ModelAttribute value without path
I have a @ModelAttribute someString in my Controller. How can I access the value in my JSP? I tried this:
but it doesn't work
Please help.

th3an0maly
- 3,360
- 8
- 33
- 54
0
votes
1 answer
how to read the already existing bean in jstl|form?
I have simple form with SpringMVC, I want retrieve my already had bean by pbid. the problem is the server side I can get the already setting bean, but the jsp side it always get new bean. Can I use the @ModelAttribute("productbean") to received some…

user504909
- 9,119
- 12
- 60
- 109
0
votes
1 answer
Java - Two different @ModelAttribute on the same view takes up same values
This is probably a very simple error somewhere. Please help.
I have a home.jsp page with two tags:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>

th3an0maly
- 3,360
- 8
- 33
- 54
0
votes
1 answer
Need to have two non-related tables in single jsp page, populate the fields with default values and one submit button
I have a Jsp page, In which if a checkbox is selected div tag will be shown. Jsp page has a form with modelattribute and div tag has another form with a different modelattribute. I need to populate the fields of Div tag form with default values…
user1480277
0
votes
2 answers
Finding a particular attribute's value from a model in Rails
I'm trying to find the value of a particular model's attribute in rails. Here's what my code in the User controller's 'create' method looks like:
@user = User.find(1, :select => :money)
existing_money = @user
puts "#{existing_money}"
In my Heroku…

dougiebuckets
- 2,383
- 3
- 27
- 37
-1
votes
1 answer
ModelAttribute fields are null
I am facing this strange behaviour whith Spring MVC and JSP where the ModelAttribute is sent to the JSP with populated fields but when it is returned to the controller all the fields are null.
So first of all I put an object as attribute in the…

Bilal Ennouali
- 319
- 2
- 5
- 15
-1
votes
1 answer
How to get modelAttribute values that are not in form, in Spring
I have an hibernate entity object. I need to update this object, so I passed this object to a form. In the form i will change some values and the others are constant. And I can not show these constant values to the client, so they should pass to…

Ali insan Soyaslan
- 836
- 5
- 14
- 33
-1
votes
1 answer
@ModelAttribute, Why If don't work?
My question is why don't enter into if when acc.getUsername equals "stringExample"? When I print acc.getUsername() this line ealier it shows its equals but dont go into if, why?
@RequestMapping(value = "/login", method = RequestMethod.POST)
…

MSB MSB
- 13
- 1
- 5
-2
votes
5 answers
Java Spring Boot: Retrieving Model Attribute
I'm developing a Java Spring Boot Web App and am having trouble retrieving a model attribute that I want to display on one of my pages. The page is "/profile" and here is the profile.jsp page:
…

CDA the Programmer
- 87
- 1
- 6
- 20