Vince Clark wrote:
That's the basics. Now to the next step, customizing the information in
the screenlets. This is where I am stuck. As far as I can tell the
process is basically to execute the bean shell (bsh file) defined in the
<action> tag of the screen definition. This interacts with the service
layer and puts information in the request object so it is accessible to
the ftl file for rendering.
I am struggling with understanding how beanshell puts the data in the
request. I see "context.put" and assume it happens here. I am also
struggling with what classes to use to get the information I need, and
how to pass these classes constraints to limit the result.
The beanshell context object is basically a HashMap that is passed to Freemarker. So anything you
"put" in the beanshell context is available to "get" in Freemarker (or screen widgets).
In bsh:
context.put("MyMessage", "Hello World!");
In ftl:
<h1>${MyMessage}</h1>