Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-5126

inconsistancy between Model Driven and Model Driven Interceptor documentations

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 6.0.0
    • None
    • None

    Description

      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 which can help you validate model's fields.

      where as the Model Driven Interceptor documentation says:

      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.

       

      Attachments

        Activity

          People

            yasserzamani Yasser Zamani
            pduroux Patrice DUROUX
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 2h 20m
                2h 20m