Java Brewer

Greenhorn
+ Follow
since Oct 13, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Java Brewer

hi Mathews,

It the case of

The class is loaded into the JVM but you haven't got the handle to the Object of the class as such. To get the Object for the class you need to do


This approach is useful when you donno which class to load on the fly. Usually used in app. server relatedt applications.
Whereas in

You have explictly created and class Object and allocated the memory.
Regards
GoodyGuy
20 years ago
hi perry,

you can always call _jspDestroy() in you JSP anywhere.
It doesn't really makes any difference as though specification says its
a life cycle method, but even calling at the begining of ur JSP doesn't
stops the JSP to execute the _jspService() method and sending the
response back to the client.
Try it once for your clarification.
Regards
GoodieGuy
20 years ago
JSP
Hi Chandaka Fernando,

Its not a good idea if you are opening Connection in every page as said by one of the friend in the post. If you are using Tomcat 4 or higher, and using Oracle Database then go to http://localhost:8080/tomcat-docs/jndi-datasource-examples-howto.html in your local machine, this page tells you how to create the DATASOURCE and how to use it in your JSP/Servlet/EJB. With this you dont have to worry about creating the connection in each and every page. If you are using some other App. Server then refer the documentation about creating the DATASOURCE for that server.
Regards
Goodieguy
20 years ago
JSP
Hi Sangeetha,

There is a definite difference. When using scope as page, the
bean instance will be available to the current page only.
Whereas when scope is request, and if you are using something
like <jsp:forward /> or RequestDispatcher.foward(req, res),
you can get the bean instance in the called JSP, and can
manipulate the object as desired in the called JSP.
I hope this is clear to you now.
Regards
Goodieguy
20 years ago
JSP
Hi Nilesh,
You need to learn a bit.. Better say this way

The above variable behaves as a local variable, as it will be
available inside the [B]service()[b] method. You wont
be able to access this variable if you have declared a method
in JSP. where as...

In this case, the variable behaves as a member variable. It will be
available thruout the JSP, and even you can access this variable
in any of you method defined in JSP. It has scope in the JSP in
which it is declared as well as in in the static include files i.e.
include using but not
available to dynamic include i.e. .

I hope this clears the doubt.
Regards
Goodieguy
20 years ago
JSP