The docs on bean:define say that it will unconditionally create or replace
the bean with specified id. However I get an error if I want to replace.
For example:
<jsp:useBean id="b1" class="MyClass">
... init stuff
</jsp:useBean>
<jsp:useBean id="b2" class="MyClass">
... init stuff
</jsp:useBean>
<bean:define id="b" name="b1" type="MyClass"/>
... do stuff with b
<bean:define id="b" name="b2" type="MyClass"/>
... do stuff with b
When compiling I get an error:
Tag attempted to define a bean which already exists: b.
What's wrong?
-Jerome