You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2021/04/25 14:38:00 UTC

[jira] [Work logged] (WW-5126) inconsistancy between Model Driven and Model Driven Interceptor documentations

     [ https://issues.apache.org/jira/browse/WW-5126?focusedWorklogId=588531&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-588531 ]

ASF GitHub Bot logged work on WW-5126:
--------------------------------------

                Author: ASF GitHub Bot
            Created on: 25/Apr/21 14:37
            Start Date: 25/Apr/21 14:37
    Worklog Time Spent: 10m 
      Work Description: yasserzamani opened a new pull request #485:
URL: https://github.com/apache/struts/pull/485


   due to refreshing model regardless of potential overridden Object.equals


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

            Worklog Id:     (was: 588531)
    Remaining Estimate: 0h
            Time Spent: 10m

> inconsistancy between Model Driven and Model Driven Interceptor documentations
> ------------------------------------------------------------------------------
>
>                 Key: WW-5126
>                 URL: https://issues.apache.org/jira/browse/WW-5126
>             Project: Struts 2
>          Issue Type: Improvement
>            Reporter: Patrice DUROUX
>            Assignee: Yasser Zamani
>            Priority: Minor
>             Fix For: 2.5.27, 2.6
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Hi,
>  
> The Model Driven documentation says:
> If an action class implements the interface {{com.opensymphony.xwork2.ModelDriven}} then it needs to return an object from the {{getModel()}} method. Struts will then populate the fields of this object with the request parameters, and *this object will be placed on top of the stack once the action is executed*. Validation will also be performed on this model object, instead of the action. Please read about [VisitorFieldValidator Annotation|https://github.com/apache/struts-site/blob/master/source/core-developers/visitor-field-validator-annotation.html] which can help you validate model's fields.
> where as the Model Driven Interceptor documentation says:
> h2. Parameters
>  * {{refreshModelBeforeResult}} - *set to true if you want the model to be refreshed on the value stack after action execution and before result execution*. The setting is useful if you want to change the model instance during the action execution phase, like when loading it from the data layer. This will result in {{getModel()}} being called at least twice.
>  
> Looking into the code shows that the default parameter value is false.
> Moreover the interceptor refresh process is based on call to the {{equals}} method and this method may have been redefined, in a JPA context for instance. The replacement is then not systematic and may not be done.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)