Tapestry
  1. Tapestry
  2. TAPESTRY-2471

Parameter fields that are updated during component event processing (such as a form submit) may not clear their values at the end of the request

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 5.0.13
    • Fix Version/s: 5.0.14
    • Component/s: tapestry-core
    • Labels:
      None

      Description

      The logic for clearing a component parameter field is added as so:

      extend method: public void postRenderCleanup()
      if (! _$model_invariant)
      {
      model = _$model_default;
      _$model_cached = false;
      }

      The problem is that this postRenderCleanup() is invoked after the component finishes rendering. If a parameter is updated as part of a form submission, this code is not called, and the parameter value is left behind. This can lead to leaks, as the parameter value is not cleared before the page is returned to the pool.

      The solution is to extend the method containingPageDidDetach() as well.

        Activity

        Hide
        Howard M. Lewis Ship added a comment -

        Added a lot of event dispatch logging logic while tracking this one down.

        Show
        Howard M. Lewis Ship added a comment - Added a lot of event dispatch logging logic while tracking this one down.
        Hide
        Howard M. Lewis Ship added a comment -

        This only affects unbound parameters:

        add method: private org.apache.tapestry5.beaneditor.BeanModel _$read_parameter_model()
        {
        if (_$model_cached || ! _$resources.isLoaded() || ! _$resources.isBound("model")) return model;
        org.apache.tapestry5.beaneditor.BeanModel result = ($r) ((org.apache.tapestry5.beaneditor.BeanModel) _$resources.readParameter("model", "org.apache.tapestry5.beaneditor.BeanModel"));
        if (_$model_invariant || _$resources.isRendering())

        { model = result; _$model_cached = true; }

        return result;
        }

        replace read model: _$read_parameter_model();

        add method: private void _$update_parameter_model(org.apache.tapestry5.beaneditor.BeanModel $1)
        {
        if (! _$resources.isLoaded())

        { model = $1; return; }

        if (_$resources.isBound("model"))
        _$resources.writeParameter("model", ($w)$1);
        model = $1;
        _$model_cached = _$resources.isRendering();
        }

        replace write model: _$update_parameter_model();

        Show
        Howard M. Lewis Ship added a comment - This only affects unbound parameters: add method: private org.apache.tapestry5.beaneditor.BeanModel _$read_parameter_model() { if (_$model_cached || ! _$resources.isLoaded() || ! _$resources.isBound("model")) return model; org.apache.tapestry5.beaneditor.BeanModel result = ($r) ((org.apache.tapestry5.beaneditor.BeanModel) _$resources.readParameter("model", "org.apache.tapestry5.beaneditor.BeanModel")); if (_$model_invariant || _$resources.isRendering()) { model = result; _$model_cached = true; } return result; } replace read model: _$read_parameter_model(); add method: private void _$update_parameter_model(org.apache.tapestry5.beaneditor.BeanModel $1) { if (! _$resources.isLoaded()) { model = $1; return; } if (_$resources.isBound("model")) _$resources.writeParameter("model", ($w)$1); model = $1; _$model_cached = _$resources.isRendering(); } replace write model: _$update_parameter_model();

          People

          • Assignee:
            Howard M. Lewis Ship
            Reporter:
            Howard M. Lewis Ship
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development