struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dave Newton (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (WW-3825) Struts2 (modeldriven) update method setting fields which do not exist on form to null
Date Tue, 22 May 2012 19:05:41 GMT

    [ https://issues.apache.org/jira/browse/WW-3825?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13281153#comment-13281153
] 

Dave Newton commented on WW-3825:
---------------------------------

If the model isn't in session, it's going to create a new model instance, and however fields
that aren't on the form are initialized is what will be in the model.

If you using a persistent object directly, then your code needs to take that in to account,
how to do so depends on the persistence mechanism you're using.
                
> Struts2 (modeldriven) update method setting fields which do not exist on form to null
> -------------------------------------------------------------------------------------
>
>                 Key: WW-3825
>                 URL: https://issues.apache.org/jira/browse/WW-3825
>             Project: Struts 2
>          Issue Type: Improvement
>    Affects Versions: 2.3.1.2
>            Reporter: Sam
>            Priority: Critical
>
> Struts 2 sets the fields values to Null, if it doesn't exists on view/jsp.
> See below link.
> http://forums.devshed.com/java-help-9/struts2-modeldriven-update-method-setting-fields-which-do-not-exist-642900.html
> I am forced to put all non view fields as HIDDEN on JSP page, to have it values transferred.
> Is there a way to retain the values of non form fields without using HIDDEN.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message