Hi thr
Well as u hav written that in a jsp file v hav scriplet and declarative sections, yes they are the part and parcel of any jsp code. And let me explain
where in the corresponding servlet they are going to be placed...
Declarative :- They become the member variable of the servlet class, so let us say if u hav only one object but maultiple threads accessing the servlet then all the threads are going to share these variables which are declared in the declarative section, not only variables u can also hav the function definition over there.
Scriplets:- They become the part of the service method, so for the same scenario as explained earlier they are going to hold different values for different threads. So v normally use scriplets to hold the processing of the
code.
That's the magic of
Java my dear friend...Cheers...! Enjoy Java