Velocity
  1. Velocity
  2. VELOCITY-146

Macros not evaluated on the first attempt with #parse

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.5
    • Fix Version/s: 1.6
    • Component/s: Engine
    • Labels:
      None
    • Environment:
      Operating System: All
      Platform: PC

      Description

      I have noticed that sometimes macros do not get evaluated after Velocity has
      just been started. A subsequent request for the same resource produces a valid
      document, where macros are now correctly evaluated.

      Here's an example: I have a WAP-Mail webapp, which runs on Tomcat 3.3a. It uses
      Velocity to render the content, and the Velocity versions I have used are 1.2-
      dep, 1.3-dep and 1.3.1-dep. This problem occurs with all of these versions.

      The first request should produce a message list (there's an autologin feature,
      so the message list page is the first one being accessed). Here's the most
      relevant part of the content:

      ------------------------------------------------------------------------------

      <p>Folder: INBOX<br/></p>

      <p>
      <br/><b>Date: 05.03 11:16</b>
      <br/>Sender: John Doe
      <br/>Subject: <a href="/wapmail/message/show/

        Activity

        Hide
        Sami Leino added a comment -

        Created an attachment (id=5159)
        Attached two relevant templates that are used in the application

        Show
        Sami Leino added a comment - Created an attachment (id=5159) Attached two relevant templates that are used in the application
        Hide
        Shinobu Kawai added a comment -

        This behaviour is stated in the user guide. Under "Velocimacro Miscellany",
        under "Can I register Velocimacros via #parse() ?".

        As it still remains in 1.5-dev, I'm changing this to an enhancement request.

        http://jakarta.apache.org/velocity/user-guide.html#Velocimacro%20Miscellany

        Show
        Shinobu Kawai added a comment - This behaviour is stated in the user guide. Under "Velocimacro Miscellany", under "Can I register Velocimacros via #parse() ?". As it still remains in 1.5-dev, I'm changing this to an enhancement request. http://jakarta.apache.org/velocity/user-guide.html#Velocimacro%20Miscellany
        Hide
        Will Glass-Husain added a comment -

        Thanks for reporting this. We're going through old bugs - we'll resolve this before 1.5 release.

        Show
        Will Glass-Husain added a comment - Thanks for reporting this. We're going through old bugs - we'll resolve this before 1.5 release.
        Hide
        Will Glass-Husain added a comment -

        I added some thoughts on resolving this to the Wiki.
        http://wiki.apache.org/jakarta-velocity/MacroIssues

        Show
        Will Glass-Husain added a comment - I added some thoughts on resolving this to the Wiki. http://wiki.apache.org/jakarta-velocity/MacroIssues
        Hide
        Will Glass-Husain added a comment -

        Upon reflection, this is trickier than it seems and is more of a design issue. Moving to version 1.6.

        Show
        Will Glass-Husain added a comment - Upon reflection, this is trickier than it seems and is more of a design issue. Moving to version 1.6.
        Hide
        Will Glass-Husain added a comment -

        This is solved and in svn head. (for version 1.6). See more detailed comments in VELOCITY-362.

        Show
        Will Glass-Husain added a comment - This is solved and in svn head. (for version 1.6). See more detailed comments in VELOCITY-362 .

          People

          • Assignee:
            Unassigned
            Reporter:
            Sami Leino
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development