I am trying to do a fairly simple (I think) thing in Cocoon (2.1.3) via FlowScript -- put an object in the HttpSession and make it available to JXTemplate.

The FlowScript looks like:

cocoon.load("resource://org/apache/cocoon/woody/flow/javascript/ woody2.js");

function login()
{
var form = new Form("forms/login.xml");
var employee = null;
var service = new Packages.com.forthillcompany.infra.serv.SecurityService();


while (employee == null)
{
form.showForm("login");
employee = service.login(form.getModel().name, form.getModel().password);
cocoon.session.setAttribute("user", employee);
}
cocoon.sendPage("home");
}


And the flow of control works correctly. It passes to a JXTemplate, this form displays correctly:

<html xmlns:i18n="http://apache.org/cocoon/i18n/2.1";>
<head>
<title>Home</title>
</head>
<body>
<i18n:text>greeting</i18n:text>, ${session.getAttribute("user").getDisplayName()}
</body>
</html>


however the more natural form:

<html xmlns:i18n="http://apache.org/cocoon/i18n/2.1";>
    <head>
        <title>Home</title>
    </head>
    <body>
        <i18n:text>greeting</i18n:text>, ${session.user.displayName}
    </body>
</html>

Does not properly find the attribute (or even the "user").

Is there something obvious that I am missing?

Changing the attribute set call in the FlowScript to "cocoon.session.user = employee;" yields identical results (though I do like that more).

Thank you!

-Brian



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to