But that doesn't work because you can't define the same bean more than once. Is there any pattern for using either bean1 and bean2 as realBean?
[disabled smilies -JM]
[ June 07, 2004: Message edited by: Jason Menard ]
I tried that and got an uninitialzed error at JSP compilation time. I guess it depends on the JVM. I'm using 1.3. What did you try it in?
As a workaround, I'm using Java code for the if/else and then using the bean:define on that value. It's a bit messy, but then again this whole thing is a workaround until I can get the logic out of the JSP.
(Sorry about the smilies. I didn't proofread my post.)
I guess the other thing you might be able to do is determine in your Action which bean to put in scope, that way you always have the right bean available for your JSP without having to do the conditionals there.
USAGE NOTE - There is a restriction in the JSP 1.1 Specification that disallows using the same value for an id attribute more than once in a single JSP page. Therefore, you will not be able to use <bean efine> for the same bean name more than once in a single page.