Hi,
Do you have any idea about what's happening when a .jsp file is turned in to .java file?A
servlet file will be created by the server.Do you know how the server is taking care of a JSP file being turned into a servlet file?What's happening to the tags that you wrote in your .jsp file? If you write bean tags like
<jsp:useBean id="xxx" class="pack1.pack2.XXX" scope="application"/>
<jsp:useBean id="yyy" class="pack1.pack2.YYY" scope="session"/>
how the server/servlet engine is interpreting these tags ?
If you say 'scope="application"' for an object xxx of class pack1.pack2.XXX then a new object is created with default constructer of that class and that object is set in the ServletContext object of that application i.e "application" is nothing but an instance of ServletContext.The "xxx" object is set into that ServletContext's instance as
application.setAttribute("xxx",new pack1.pack2.XXX());
Similar is the case with scope "session" also. The instance of class pack1.pack2.YYY is set into HttpSession object as
sesison.setAttribute("yyy",new pack1.pack2.YYY);
Hope your doubt is clarified.If you have any other doubts in this regard do not hesitate to contact me.
Regards
Soma.