Struts 2
  1. Struts 2
  2. WW-3587

Provide Mechanism to replace FreeMarker with Java Template, enhance Java Template features

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.1.1
    • Fix Version/s: 2.2.3
    • Labels:
      None

      Description

      We recently did some profiling and identifying of inefficiencies within our system. Part of our search found FreeMarker was not as quick as we would like. We found Java Template as an alternative and began incorporating it.

      Java Template required some changes on our part.

      • Radio and checkboxes were not implemented.
      • We added cssClass and cssStyle to the submit tag.
      • We removed unused imports from the head tag.
      • FieldError required an unordered list of errors which could not be presented in the way we needed. We changed to a break-row-delimited and 'red' block. Admittedly, this solution is fairly custom to our solution, but I feel you will see our need here. Let me know if you need more info.

      Dropping Java Template into our project still requires us to include FreeMarker.

      Our goals:

      We are currently branching Java Template within our project. We do not want to do this for very long. Three of the solutions we created for Java Template seem like global improvements. The FieldError change might be harder to solve globally, but I think our desires are mentioned. We are asking for these changes to be applied to the Java Template project, so we no longer have to maintain them internally. Hopefully the community can benefit from these updates.

      I am not a fan of toting around FreeMarker within our project even though we are no longer using it. We have not researched how we can solve this, but would appreciate suggestions or a global solution.

      I can provide source for the Java Template changes but this form does not have an attachment feature. Maybe the next page. If not, let me know, and we can coordinate.

      1. SubmitHandler.java
        3 kB
        Dustin Digmann
      2. SimpleTheme.java
        4 kB
        Dustin Digmann
      3. RadioHandler.java
        3 kB
        Dustin Digmann
      4. FieldErrorHandler.java
        2 kB
        Dustin Digmann
      5. CheckBoxListHandler.java
        3 kB
        Dustin Digmann

        Issue Links

          Activity

          Dustin Digmann created issue -
          Hide
          Dustin Digmann added a comment -

          Adding Java Template changes.

          Show
          Dustin Digmann added a comment - Adding Java Template changes.
          Dustin Digmann made changes -
          Field Original Value New Value
          Attachment CheckBoxListHandler.java [ 12473283 ]
          Attachment FieldErrorHandler.java [ 12473284 ]
          Attachment RadioHandler.java [ 12473285 ]
          Attachment SimpleTheme.java [ 12473286 ]
          Attachment SubmitHandler.java [ 12473287 ]
          Hide
          Maurizio Cucchiara added a comment - - edited

          I have just two simple notes (although I could be wrong).
          In order to include your code in the trunk:
          1. you should set the flag "ASF Granted Licence"
          2. you should remove the copyright stuff (again I could be wrong)

          Lets see what other has to say about this.

          Show
          Maurizio Cucchiara added a comment - - edited I have just two simple notes (although I could be wrong). In order to include your code in the trunk: 1. you should set the flag "ASF Granted Licence" 2. you should remove the copyright stuff (again I could be wrong) Lets see what other has to say about this.
          Dustin Digmann made changes -
          Attachment CheckBoxListHandler.java [ 12473283 ]
          Dustin Digmann made changes -
          Attachment FieldErrorHandler.java [ 12473284 ]
          Dustin Digmann made changes -
          Attachment RadioHandler.java [ 12473285 ]
          Dustin Digmann made changes -
          Attachment SimpleTheme.java [ 12473286 ]
          Dustin Digmann made changes -
          Attachment SubmitHandler.java [ 12473287 ]
          Hide
          Dustin Digmann added a comment -

          Removed our licensing. Granting whatever licensing makes this work.

          Show
          Dustin Digmann added a comment - Removed our licensing. Granting whatever licensing makes this work.
          Dustin Digmann made changes -
          Attachment CheckBoxListHandler.java [ 12473318 ]
          Attachment FieldErrorHandler.java [ 12473319 ]
          Attachment RadioHandler.java [ 12473320 ]
          Attachment SimpleTheme.java [ 12473321 ]
          Attachment SubmitHandler.java [ 12473322 ]
          Maurizio Cucchiara made changes -
          Assignee Maurizio Cucchiara [ maurizio.cucchiara ]
          Hide
          Maurizio Cucchiara added a comment -

          Thanks Dustin.
          Patch applied.
          Again, only two notes:

          • I had to rename the CheckBoxListHandler in CheckboxListHandler for the sake of the coherence (almost every reference to the checkbox follows this kind of pattern).
          • Unfortunately I cannot applied your changes on FieldErrorHandler because they break the default behaviour of generic simple theme (furthermore some test fail)
          Show
          Maurizio Cucchiara added a comment - Thanks Dustin. Patch applied. Again, only two notes: I had to rename the CheckBoxListHandler in CheckboxListHandler for the sake of the coherence (almost every reference to the checkbox follows this kind of pattern). Unfortunately I cannot applied your changes on FieldErrorHandler because they break the default behaviour of generic simple theme (furthermore some test fail)
          Maurizio Cucchiara made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 2.2.2 [ 12315200 ]
          Resolution Fixed [ 1 ]
          Hide
          Dustin Digmann added a comment -

          No worries on FieldErrorHandler. I think we have come up with a solution using the original version.

          Show
          Dustin Digmann added a comment - No worries on FieldErrorHandler. I think we have come up with a solution using the original version.
          Maurizio Cucchiara made changes -
          Link This issue incorporates WW-3388 [ WW-3388 ]
          Maurizio Cucchiara made changes -
          Link This issue incorporates WW-3390 [ WW-3390 ]
          Lukasz Lenart made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

            • Assignee:
              Maurizio Cucchiara
              Reporter:
              Dustin Digmann
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development