hi all...
let's say from a servlet i want to call a class and method in that class
could i have an advice about what is the best way to do it
***
instanciate the class in the servlet init
MyClass mc = null;
public void init() throws ServletException {
mc = new MyClass();
}
processRequest(HttpServletRequest request, HttpServletResponse response) {
...
mc.doThat(whatever);
...
}
***
load it dynamically each time the servlet is called
processRequest(HttpServletRequest request, HttpServletResponse response) {
...
Class c = Class.forName(MyClassName);
mc = (MyClass)c.newInstance();
mc.doThat(...);
}
***
or use a utility Bean, put it in the servlet context
and call the func when i need it
***
does this all make any difference
thanks
alain
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html