Ugo Cei wrote:
Il giorno 18/mag/05, alle 02:56, Vadim Gritsenko ha scritto:
+ Session session =
ObjectModelHelper.getRequest(objectModel).getSession(true);
+ session.setAttribute(SESSION_ATTR_PREFIX + getId(),
generateSecret());
Such session attribute name is not unique (two forms with similar
widget id). Why not use widget.set/getAttribute?
That would be a problem only if you had two forms on the same page
having two different widdgets with the same id. Or the same form open in
two browser windows at once.
Or if you click back button, etc. There are multiple scenarios.
Anyway, it's probably safer to use a generated, random id.
This will be safer, please do it :-)
Vadim
The problem with using a widget attribute is that the attribute value
must be accessible to the component that generates the image, which is
not aware of the form.
Ugo