The reason, why it does not work, is jsp:useBean standard action's default scope is page. It is impossible to set attribute into page scope in servlet. If appropriate scope attribute is added into jsp:useBean, the example should work.
Joined: Jan 16, 2005
cool....thanks Jan [ June 27, 2006: Message edited by: Jas Oberai ]
According to the question I do not think the tag will work.even if you changed the scope to request in the tag. This is because the new attribute is not created if you are not using class attribute. As we have only type then and when ever only type attribute is used then we should ensure that the bean is already present.