Questions tagged [spring-form]

A set of tags provided by Spring that help rendering and processing forms on JSP pages.

213 questions
18
votes
3 answers

Keep value in model attribute for spring mvc

When I'm using a Spring MVC controller and I submit a form by setting value to the modelAttribute I lose some of the model's fields which are not mapped in the form. In this example, because I didn't map age and address, these user's fields are lost…
julus
  • 431
  • 1
  • 5
  • 14
9
votes
3 answers

Spring form:input for number

I am using Spring's form:input as below : in my jsp but when I check the html that is rendered on the browser it shows like : type="number" type="text" i.e., two type attributes are generated in the html. On…
iAmLearning
  • 1,153
  • 3
  • 15
  • 28
8
votes
1 answer

JSP Error Unable to locate tag attribute info for tag attribute aria-describedby spring form

I am trying to add aria-describedby to springform. It's throwing a JSP error. When I tried to use the same aria-* attribute in div tag those are working in the same page. aria-* is not working for spring form. It's working in div in the same jsp…
cvsr.sarma
  • 879
  • 1
  • 13
  • 29
7
votes
0 answers

How to setup FORM binding in Spring MVC 4.3 to have in controller an appropriate child object of the inheritance tree

I'm making changes in a very old application. which is using Spring MVC 4. I need to post data from a form:form tag within in JSP for Spring controller. UI is fixed and I can only make changes at server side. Based upon a specific field in my…
7
votes
1 answer

Spring 3.0 MVC binding nested object

Why is spring not binding the values on my nested object? The SecurityQuestion object on the RegistrationBean is set with question and answer as null, null, respectively, despite setting then in form using bean notation in the view. Beans: public…
dom farr
  • 4,041
  • 4
  • 32
  • 38
7
votes
1 answer

Spring mvc miss id of dependent collection when combine form object from jsp

I have following controller to return view: @RequestMapping(value = "/admin/adminUsers", method = RequestMethod.GET) public String adminUsers(ModelMap model, HttpSession session) { Set users =…
gstackoverflow
  • 36,709
  • 117
  • 359
  • 710
6
votes
3 answers

How to bind subclass object in spring form submit as modelAttribute

I Have Class Shape { //Implementation } Class Round extends Shape{ //Implementation } Controller I Have @Requestmapping(value="/view/form") public ModelAndView getForm(){ ModelAndView mav=new ModelAndView(); mav.addObject("shape",new…
S.M.V.A
  • 470
  • 1
  • 5
  • 14
6
votes
4 answers

java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name 'category' available as request attribute

I looked almost all answers related this problem on the web but could not figure out the problem in my code. Here is my JSP page.
likeachamp
  • 765
  • 4
  • 11
  • 21
5
votes
1 answer

How to save many objects in a spring

@Component @Entity @Table(name="menu") @Configurable public class Menu implements Serializable{ .... @OneToMany(mappedBy="menu", fetch=FetchType.EAGER) private Set voceMenuList; public Set
MDP
  • 4,177
  • 21
  • 63
  • 119
5
votes
3 answers

Spring Validation: Requiring an exact length on an optional field

In Spring MVC, I'm attempting to use annotations to perform validation of form input. I have some fields that are optional, but when input is provided, it must meet certain criteria. For example, I have one field that can be left blank, but when…
Marvo
  • 17,845
  • 8
  • 50
  • 74
5
votes
1 answer

Spring Framework tag not showing errors

I know there are many similar questions here, but none of them solved my problem. I'm using Spring 4.0.3 and Hibernate Validator 5.1.0. The problem occurs when I try to omit the path attribute of the tag, so:
lalsberg
  • 53
  • 1
  • 1
  • 4
4
votes
3 answers

spring form jsp binding reference bean

I was trying to bind POJO using spring form tag library. After binding reference class bean variables, I am getting "Bad Request Error- Http Status 400". If I remove binding of reference class, My form is submitted successfully and values are also…
Ankit
  • 2,126
  • 4
  • 33
  • 53
4
votes
2 answers

Spring Form Validation Error: java.lang.IllegalArgumentException: 'items' must not be null

I am trying to Validate Spring form which includes: Normal input fields Radio buttons whose options are set in controller (later may come from database) Check box whose options are also set in controller Select field which is also set in…
Chandra Prakash
  • 781
  • 4
  • 13
  • 23
4
votes
2 answers

Spring MVC binding nested objects

I have an instance of the following class what i would like to edit in a from, and then save it back at the backend. public class NestedClass { List inners = new LinkedList(); //getter and setter public class…
Szilard
  • 73
  • 2
  • 6
3
votes
1 answer

Spring 5 immutable form to use an all arg constructor when there is No argument constructor as well

In an immutable class/object I have one no argument constructor initializing values to default/null, and another required argument constructor that initializes all the values to arguments from constructor. When using the form binding (by specifying…
akk202
  • 194
  • 1
  • 10
1
2 3
14 15