Uploaded image for project: 'LAMS Development'
  1. LAMS Development
  2. LDEV-2839

Precompile JSPs so we can use JBoss with JRE 1.6

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4
    • Fix Version/s: 2.4
    • Component/s: General, Tools
    • Labels:
      None

      Description

      Create an ant task that would precompile all the jsps in all modules so when instead of needing the full JDK (so the JSPS get compiled the first time they get used), they are already precompiled and can be run with JRE 1.6 instead.

        Activity

        ernieg Ernie Ghiglione created issue -
        ernieg Ernie Ghiglione made changes -
        Field Original Value New Value
        Component/s General [ 10012 ]
        Component/s Tools [ 10015 ]
        Hide
        marcin Marcin Cieslak added a comment -
        A working solution was delivered for Forum Tool as an example.

        Precompiling JSPs takes away hotdeploy feature, useful in development. It also takes more time to build LAMS.
        Taking above into account, precompilation of JSPs was introduced as an optional feature.
        It is controlled globally for whole LAMS by uncommenting "jsp.precompile" setting in lams_build/common.properties file. Note that the value of this setting does not matter, it can be even "false" - if it is uncommented, JSPs will get precompiled.


        1. If "jsp.precompile" is set, Ant task "jsp-precompile" will run before "build-war" task:

        It copies all content from Tool's web folder and further steps are done on this copy.
        Precompilation of JSPs alters WEB-INF/web.xml file, mappings (JSP path) -> (precompiled class) are added. If copy wasn't made, original web.xml file would be altered, which is not desired, especially in Tools like Q&A where web.xml is not generated by xdoclet parts and changes need to be committed to CVS.

        Next JSP compiler is defined and Java source are generated from JSP files. This is also the step where mappings are added to web.xml file.
        Then Java classes are compiled into .class files.
        In the end, web folder is copied again to another location (assembly), including new class files and excluding unnecessary JSPs and tags.
        Basing on this assembly folder Tool WAR gets created.


        2. If "jsp.precompile" is not set, Ant task "jsp-plaincopy" will run before "build-war" task:

        It copies all content from Tool's web folder to assembly folder - not really needed, but useful for compability with "jsp-precompile" task.
        Basing on this assembly folder Tool WAR gets created.


        If solution is accepted, it will be applied to other LAMS web components.
        Show
        marcin Marcin Cieslak added a comment - A working solution was delivered for Forum Tool as an example. Precompiling JSPs takes away hotdeploy feature, useful in development. It also takes more time to build LAMS. Taking above into account, precompilation of JSPs was introduced as an optional feature. It is controlled globally for whole LAMS by uncommenting "jsp.precompile" setting in lams_build/common.properties file. Note that the value of this setting does not matter, it can be even "false" - if it is uncommented, JSPs will get precompiled. 1. If "jsp.precompile" is set, Ant task "jsp-precompile" will run before "build-war" task: It copies all content from Tool's web folder and further steps are done on this copy. Precompilation of JSPs alters WEB-INF/web.xml file, mappings (JSP path) -> (precompiled class) are added. If copy wasn't made, original web.xml file would be altered, which is not desired, especially in Tools like Q&A where web.xml is not generated by xdoclet parts and changes need to be committed to CVS. Next JSP compiler is defined and Java source are generated from JSP files. This is also the step where mappings are added to web.xml file. Then Java classes are compiled into .class files. In the end, web folder is copied again to another location (assembly), including new class files and excluding unnecessary JSPs and tags. Basing on this assembly folder Tool WAR gets created. 2. If "jsp.precompile" is not set, Ant task "jsp-plaincopy" will run before "build-war" task: It copies all content from Tool's web folder to assembly folder - not really needed, but useful for compability with "jsp-precompile" task. Basing on this assembly folder Tool WAR gets created. If solution is accepted, it will be applied to other LAMS web components.
        Hide
        ernieg Ernie Ghiglione added a comment -
        Tested it while tested the installers. This is woking greate resolving and closing now
        Show
        ernieg Ernie Ghiglione added a comment - Tested it while tested the installers. This is woking greate resolving and closing now
        ernieg Ernie Ghiglione made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        ernieg Ernie Ghiglione added a comment -
        done
        Show
        ernieg Ernie Ghiglione added a comment - done
        ernieg Ernie Ghiglione made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            marcin Marcin Cieslak
            Reporter:
            ernieg Ernie Ghiglione
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development