Back Forum Reply New

Predefined form backing object not rebound on submit

', 'streetAddress' -gt; ' ', 'state' -gt; '', 'city' -gt; ' ']], requestScope = map['msg' -gt; 'User is null, the user modify request cannot be created.'], attributes = map[[empty]], flowExecution = [FlowExecutionImpl@2f736892 flow = 'um-home-flow', flowSessions = list[[FlowSessionImpl@5c212893 flow = 'um-home-flow', state = 'displayProfileUpdate', scope = map['umHomeCommand' -gt; com.somecompany.umportlet.UmHomeCommand@76686893, 'currentFormObject' -gt; com.somecompany.umportlet.UmHomeCommand@76686893], flashMap = map['org..validation.BindException.umHo  meCommand' -gt; org..validation.BindException: org..validation.BeanPropertyBinding  Result: 0 errors, 'org..validation.BindException.curr  entFormObject' -gt; org..validation.BindException: org..validation.BeanPropertyBinding  Result: 0 errors], status = Suspended], [FlowSessionImpl@60ada893 flow = 'profile-update-flow', state = 'displayProfileUpdateDone', scope = map['user' -gt; com.somecompany.common.User@6160e893, 'currentFormObject' -gt; com.somecompany.common.User@6160e893, 'targetUserId' -gt; 'xlkfjjd'], flashMap = map['org..validation.BindException.curr  entFormObject' -gt; org..validation.BindException: org..validation.BeanPropertyBinding  Result: 0 errors, 'org..validation.BindException.user  ' -gt; org..validation.BindException: org..validation.BeanPropertyBinding  Result: 0 errors], status = Active]]]], context = [null]] failed - make sure the expression is evaluatable on the target object; nested exception is ognl.OgnlException: source is null for getProperty(null, quot;userIdquot;)
Caused by: ognl.OgnlException: source is null for getProperty(null, quot;userIdquot;)

It's clear here that the form backing object targetUser hasn't been bound after submit and it's passed to my service method as null. That's why the expression flowScope.targetUser.userId cannot be evaluated. The question is why, since the targetUser is still the form backing object and all the values from the form (listed in the message) should have been bound to it and placed in the flowScope.

Could anyone please shed some light on why my form backing object is not being populated with the values from the form? Any input is greatly appreciated.

Regards,

I resolved/circumvented this issue by abandoning my, obviously wrong, assumption that the Spring Web Flow would use commandName from the Spring form tag in the JSP view for formObjectName. So I just refer to the form backing object using default name user instead of targetUser as highlighted in my previous posting above.

However, I think it would be natural for Web Flow to use a commandName from the view as a formObjectName (or not!?).

It would be great if someone from the developers could comment on this conclusion. Thank you.

Regards,
¥
Back Forum Reply New