I have an action class in which I've instantiated a bean, and called request.setAttribute("output", <my bean here>);
 
Now, in my JSP, I'm trying to "get at" that bean with <bean:define...>.  I'm having a bit of trouble understanding the difference between the "id" and the "name" parameters.
 
I can't use <bean:define name="output" type="the.correct.type">, since the "id" parameter is required.  However, <bean:define id="output" type="the.correct.type"> gives me an error. (null pointer exception in the page context findAttribute() call).
 
What DOES seem to work is <bean:define id="anythingIChoose" name="output" type="the.correct.type"> followed by <bean:write name="output" property="someBeanProperty">
 
Also curiously (to me anyway), <bean:write name="anythingIChoose" property="someBeanProperty"> seems to work if preceeded by the above <bean:define...>.
 
Can someone tell me what the id and name parameters do for bean:define, when all I'm looking to do is reference a bean on the request put there by the action class?  It appears that id, although required by the TLD, needn't be used, though it CAN be.  What's the preferred pattern here?
 
 
--
Mike Campbell Email: [EMAIL PROTECTED]
S1 Corporation voice: 678.421.4641
Software Engineer fax: 678.421.4865
R & D web: http://www.s1.com/
Black Knight
 

Reply via email to