Originally posted by mallika shah:
As in HF book it says,"dont put the "id" name of the attribute here .Page 446(with a body)
It needs a value that resolves toa real thing..
Imagine your bean has been created and set as a request (or any other scope's) attribute named "myBean". What you cannot do is:
<c:set target="myBean" property="name" value="mallika"/>
Because "myBean" is not an object, just the attribute name that 'refers' to that object. But you could use EL to get the real object: target="${myBean}".
The JSP code you pasted is alright because:
1) <jsp:useBean id="beans" class="model.BookDB"/> creates a model.BookDB object (the bean) with name "beans" (aka the attribute name) in page scope IIRC.
2) <c:set target="${beans}" property="name" value="mallika"/> is fine because ${beans} evaluates to the object itself (print ${beans} in your page and you will get the model.BookDB.toString() result printed out: something like @09874A, the default toString() method if you did not override it in your bean's class).
I hope I did not complicate things even more :-)
[ April 03, 2007: Message edited by: Sergio Tridente ]