Originally posted by Joe Khan:
But I'm still wondering why resource injection is not allowed but 'InitialContext().lookup("xyz")' is allowed to find a bean, in a JSP page.
While discouraged, the JSP spec allows any code to be run in a scriplet. It can't change this now or JSPs won't be backward compatible. Someone could have a JSP 1 file around that has all sorts of stuff in it. When J2EE 5 was written, the practice of leaving such code out of the JSP was well established. Since they didn't need to worry about backward compatibility (nobody was using resource injection as it is new), they decided not to add it.
sorry If I'm bugging you or something.
You're not
. It's good to ask follow ups as it helps clarify the answer. It also helps me learn to better formulate replies in the first place!