Tapestry
  1. Tapestry
  2. TAPESTRY-2308

Don't create HttpSession when persisted property is null

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 5.0.11
    • Fix Version/s: 5.0.12
    • Component/s: tapestry-core
    • Labels:
      None

      Description

      When persisting properties using "session" it would be nice if the session was only created after a non-null value was assigned to the property.

      It should be enough to add a simple guard in AbstractSessionPersistentFieldStrategy#postChange

      Session session = _request.getSession(newValue != null);
      if (session != null)

      { session.setAttribute(builder.toString(), newValue); }

      allowing existing session values to be replaced if the session exists, but not storing a value if no session exists.

        Activity

        Josh Canfield created issue -
        Howard M. Lewis Ship made changes -
        Field Original Value New Value
        Assignee Howard M. Lewis Ship [ hlship ]
        Howard M. Lewis Ship made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Howard M. Lewis Ship made changes -
        Resolution Fixed [ 1 ]
        Fix Version/s 5.0.12 [ 12313048 ]
        Status In Progress [ 3 ] Closed [ 6 ]
        Mark Thomas made changes -
        Workflow jira [ 12427550 ] Default workflow, editable Closed status [ 12568713 ]
        Mark Thomas made changes -
        Workflow Default workflow, editable Closed status [ 12568713 ] jira [ 12591740 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development