Uploaded image for project: '[Read Only] - Hippo Site Toolkit 2'
  1. [Read Only] - Hippo Site Toolkit 2
  2. HSTTWO-4228

[SPA++] Add Model Contribution APIs in HstRequest and HstRequestContext

    XMLWordPrintable

Details

    • New Feature
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • 5.3.0
    • None
    • None

    Description

      Add the following API:

      HstRequest#setModel(String name, Object model);
      <T> T HstRequest#getModel(String name);
      Enumeration<String> HstRequest#getModelNames();
      Map<String, Object> HstRequest#getModelsMap();
      

      Also, HstRequest#getAttribute(name) should fall back to #getModel(name) when no request attribute is found. Otherwise, any access to the model in JSP/FreeMarker (which convert request attributes to the models in view automatically) can fail.
      And, HstRequest#getAttributeNames() should combine model names for the same reason.

      The same pattern applies to HstRequestContext.

      By providing the APIs in both HstRequest and HstRequestContext, a component can decide where to contribute. The former one is supposed to be non-global ones whereas the latter one is supposed to be global one in the request processing.

      Attachments

        Activity

          People

            Unassigned Unassigned
            wko Woonsan Ko (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: