Tapestry
  1. Tapestry
  2. TAPESTRY-2421

Allow Tapestry4/Tapestry5 to be deployed in the same WAR

    Details

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

      Description

      The main opposition to deploying a WAR containing both the T4 and the T5 libraries is class name conflicts in the org.apache.tapestry package.

      For a brief time, it was considered to rename org.apache.tapestry to org.apache.tapestry5.

      However, more research shows that there are only three naming conflicts:

      org.apache.tapestry.PageRenderSupport
      org.apache.tapestry.TapestryConstants
      org.apache.tapestry.TapestryUtils

      These could be rename or otherwise refactored to avoid the conflicts.

      In theory, and with a small amount of configuration, it should be possible to run Tapestry 4 and Tapestry 5 side-by-side in the same WAR. The shared third-party dependencies, such as commons-logging and Javassist, should be compatible.

      T4 Friendly URLs might have to be disabled, however; otherwise it becomes very difficult to determine which requests are for T5 and which are for T4.

      Tapestry 3 has no overlap with Tapestry 5.

        Activity

        Hide
        Howard M. Lewis Ship added a comment -

        I just discovered an error in my tool chain, there's actually a few more conflicts:

        org.apache.tapestry.PageRenderSupport
        org.apache.tapestry.TapestryConstants
        org.apache.tapestry.TapestryUtils
        org.apache.tapestry.annotations.Component
        org.apache.tapestry.annotations.InjectComponent
        org.apache.tapestry.annotations.InjectPage
        org.apache.tapestry.annotations.Meta
        org.apache.tapestry.annotations.Parameter
        org.apache.tapestry.annotations.Persist
        org.apache.tapestry.json.JSONArray
        org.apache.tapestry.json.JSONObject
        org.apache.tapestry.json.JSONObject$1
        org.apache.tapestry.json.JSONObject$Null
        org.apache.tapestry.json.JSONTokener
        org.apache.tapestry.services.ApplicationGlobals
        org.apache.tapestry.services.ApplicationInitializer
        org.apache.tapestry.services.ComponentMessagesSource
        org.apache.tapestry.services.RequestGlobals
        org.apache.tapestry.util.UtilMessages

        Show
        Howard M. Lewis Ship added a comment - I just discovered an error in my tool chain, there's actually a few more conflicts: org.apache.tapestry.PageRenderSupport org.apache.tapestry.TapestryConstants org.apache.tapestry.TapestryUtils org.apache.tapestry.annotations.Component org.apache.tapestry.annotations.InjectComponent org.apache.tapestry.annotations.InjectPage org.apache.tapestry.annotations.Meta org.apache.tapestry.annotations.Parameter org.apache.tapestry.annotations.Persist org.apache.tapestry.json.JSONArray org.apache.tapestry.json.JSONObject org.apache.tapestry.json.JSONObject$1 org.apache.tapestry.json.JSONObject$Null org.apache.tapestry.json.JSONTokener org.apache.tapestry.services.ApplicationGlobals org.apache.tapestry.services.ApplicationInitializer org.apache.tapestry.services.ComponentMessagesSource org.apache.tapestry.services.RequestGlobals org.apache.tapestry.util.UtilMessages
        Hide
        Howard M. Lewis Ship added a comment -

        I've had to do a couple of renames, including renaming org.apache.tapestry.annotations to org.apache.tapestry.annotation.

        I've created an org.apache.tapestry5 package to store the JSON stuff and the couple of conflicting services.

        Show
        Howard M. Lewis Ship added a comment - I've had to do a couple of renames, including renaming org.apache.tapestry.annotations to org.apache.tapestry.annotation. I've created an org.apache.tapestry5 package to store the JSON stuff and the couple of conflicting services.
        Hide
        Massimo Lusetti added a comment -

        Wouldn't be more clean to have all T5 stuff within tapestry5 name schema?
        Or are you doing this to adhere to java packaging name convention which suggest to have package names reflect domains name?

        Show
        Massimo Lusetti added a comment - Wouldn't be more clean to have all T5 stuff within tapestry5 name schema? Or are you doing this to adhere to java packaging name convention which suggest to have package names reflect domains name?
        Hide
        Howard M. Lewis Ship added a comment -

        End up doing the org.apache.tapestry5 rename.

        Must have messed up a testng.xml file, because we are missing a few tests now.

        Show
        Howard M. Lewis Ship added a comment - End up doing the org.apache.tapestry5 rename. Must have messed up a testng.xml file, because we are missing a few tests now.
        Hide
        Andres March added a comment -

        WTF, a package refactoring and class renaming in a patch? At least some documentation on where to find the constants would have been a good idea.

        Show
        Andres March added a comment - WTF, a package refactoring and class renaming in a patch? At least some documentation on where to find the constants would have been a good idea.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development