----- Original Message -----
Sent: Friday, September 05, 2003 6:40
PM
Subject: Problems using Java code in Flow
Scripts
Hello,
at first I would say that the concept of
Control Flow is one of the best concepts I have ever heard in web
development. The use of Flow Script is very easy and fantastic. But there is
one big problem for me: It's not possible to use the Flow Script in
professional applications! The reason: There are many, many problems of
using Java-Code in the Flow Script.
An example: Why cause the following lines a
NullPointerException
function main() {
importClass(Packages.foo.bar.User);
user = new User();
user.setName("Donald Duck");
user.setPassword("foo");
user.setActive(false);
cocoon.sendPage("example.jxt",{"user",
user});
}
and the following - without the user object as
parameter for sendPage - not?
function main() {
importClass(Packages.foo.bar.User);
user = new User();
user.setName("Donald Duck");
user.setPassword("foo");
user.setActive(false);
cocoon.sendPage("example.jxt");
}
My JXTemplate looks like the following
lines:
<?xml version="1.0"
encoding="ISO-8859-1"?>
<html>
<header>
<titleTest</title>
</header>
<body>
<!-- commenting this
doesn't solve the problem --->
Name:
${user.name}
</body>
</html>
The object "user" exists at foo.bar and the
pipeline works fine, because I had tested it with other calls from the
Flow Script. And yes, I have already cleared the "works"
directory.
But this is not just the only problem. There are
many other strange problems using Flow Script:
Sometimes - not anytime - after an error
executing a Flow Script has occured, the Flow Script file is not longer
readable and blocked. Why? Not closed Stream? Only restarting tomcat solves
this problem.
Using JXForms with JavaBeans containing a
String[] Array for example doesn't work. But there is no error message
displayed. System, please speak with me! On the other hand, using
collections works fine.
Sometimes, after I had placed many Java-Code into
my Flow Script, the call of the function cocoon.sendPage() has no effect. No
error message displayed, too!
Has anyone one of these problems,
too?
It would be nice, if anyone can tell me how to
solve these problems, because I love the use of Flow Script and I want to use
it in all my future applications. But with these problems, there is no way to
do that.
Thank you.
Stephan Niedermeier