Uploaded image for project: 'Tapestry'
  1. Tapestry
  2. TAPESTRY-132

Reusing pooled engines may lead to wrong generated URLs

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Resolution: Incomplete
    • 3.0
    • None
    • Framework
    • None
    • Operating System: Other
      Platform: Other
    • 27621

    Description

      1. Error description:

      Reusing pooled engines may lead to wrong generated URLs.

      The following servlet-mapping

      <servlet-mapping>
      <servlet-name>MyApplicationServlet</servlet-name>
      <url-pattern>*.place</url-pattern>
      </servlet-mapping>

      can be used to provide different information in the servlet-path
      of different users.

      The AbstractEngine stores this servlet-path in _servletPath
      and the engine ends up in the ApplicationServlet._enginePool
      for reuse under certain conditions.

      ApplicationServlet#doService:
      ...
      // No session; the engine contains no state particular to
      // the client (except for locale). Don't throw it away,
      // instead save it in a pool for later reuse (by this, or another
      // client in the same locale).

      if (LOG.isDebugEnabled())
      LOG.debug("Returning " + engine + " to pool.");

      _enginePool.store(engine.getLocale(), engine);

      If this engine is reused by another client, the _servletPath
      will not be updated to the one of the new client, since

      AbstractEngine#setupForRequest:
      ...
      if (_servletPath == null)

      { ... }

      This my lead to wrong URLs since in e.g EngineServiceLink
      the servletPath of the engine is used.

      EngineServiceLink#constructURL:

      buffer.append(_cycle.getEngine().getServletPath());

      Conclusion

      a) Reset the _servletPath, when sending thee engine to the pool
      b) Do not pool engines anyway

      Attachments

        Activity

          People

            Unassigned Unassigned
            frericksm Michael Frericks
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: