0

I am attempting to upgrade Cheetah in a work project from 0.9 to 2.4.4. I'm getting some odd errors when creating certain variables inside templates. Below is an example:

#set formUtil = $iLib.aquariumFactory("widget.FormUtil",
    defaults=[{"username": $session.get("username")}, $form])

This produces the following error on compilation:

NotFound: cannot find 'get' while searching for 'get'

If I refactor like so:

#set username = $session.get("username")
#set formUtil = $iLib.aquariumFactory("widget.FormUtil",
    defaults=[{"username": $username}, $form])

I get no errors. I get similar errors in other places ("Cannot find X while searching for X"), but I'm not clear what changed in Cheetah so that I can address it in a consistent way.

Botono
  • 65
  • 1
  • 5

1 Answers1

1

I figured out the issue. Cheetah's WebWare Servlet code has variables for request, response, session and transaction. These variables become placeholders in templates. If you don't use WebWare then these placeholders will be set to None and will override any like-named values in the search list.

Botono
  • 65
  • 1
  • 5