Hello World example
new2jbossapp May 17, 2004 5:43 PMHi howard !
I am glad you commented and I am ok to provide you feedbacks.
First point :
when a page is redirected, the vaidate method is never called a second time. I think such a behaviour would be usefull. It comes from the service method of AbstractEngine :
service()
{
...
try { service.service(this, cycle, output);
}
...
catch(RedirectException e)
{
redirect(ex.getTargetPageName(), cycle, output, ex);
}
...
}
redirect(...)
{
...
IPage page = cycle.getPage(pageName);
cycle.setPage(page);
renderResponse(cycle, out);
...
}
and in DirectService :
service(...)
{
...
IPage page = cycle.getPage(pageName);
...
page.validate(cycle);
...
engine.renderResponse(cycle, output);
...
}
you see that validate is not called when I redirect
to a page. Therefore I added a validateBusiness method
that is called every time a page is going to be
validated, because I feel it like that. What' your
POV ?
Second point :
I did a form componenet with many properties that go in a map.
AFAIK the tapestry way,
<component-specification>
...
...
</component-specification>
in the class :
public void getAddress()
{
return map.get("address");
}
public void setAddress(String address)
{
map.put("address", address);
}
what I did is simply to intercept call to the
class by binding some code thanks to ognl with smth
like :
public Object getProperty(
Map context,
Object target,
Object name)
throws OgnlException
{
return map.get(name);
}
that mean I can save some *stupid* code.
Some feedback in general :
I wish tapestry would have more generic
way to generate page components. For instance a
component could be generated programmatically on the fly when a page is rendered according to some metadata.
Second I *really* wish tapestry would integrate
JAAS for security. So far I am using it in forum
code.
That would be usefull for everyone using tapestry + jboss.
To my taste, validate() is a little bit light for security
purposes. But that could be jboss specific and you
don't want that. Anyway there might be smth to do :
JAAS + jboss JAAS specific pluggin.
I would like also to EJB locals usable directly.
for instance :
public UserEJBLocal getUser()
{
return a EJB local user;
}
public void edit(IRequestCycle cycle)
{
UserEJBLocal user = cycle.getParameters()[0];
...
do smth with that damn user
}
that mean transparently encode EJB pk + a way to find
its home and decode it later.
I hope to have brought some ideas and that my POV
is not flawed or insane.
julien