at the time the <jsp:setProperty name="b" property="p" value="new"/> is executed, there exist two beans named b. One in request scope the other in session scope.
setProperty tag does not accept scope attribute so it starts to search through all scopes starting with page scope, then request scope and so on. It sets the property of the first bean found.
In your example it sets the "new" value to the bean in the request scope so the bean in session scope is left uninitialized.
[ January 08, 2007: Message edited by: Jasiek Motyka ] [ January 09, 2007: Message edited by: Jasiek Motyka ]
Joined: Nov 10, 2006
i also tried out myself, in short,
- set/getAttribute methods: always scoped - jsp:useBean: always scoped - jsp:set/getProperty: scope order from request, session and likewards - EL bean without scope prefix, scope order from request, session and likewards - EL bean with scope prefix, always scoped