Hi Abhay,
Okay suppose I instantiate a servlet as U have mentioned. What if the method
needs to sendredirect to a page?
suppose my method is defined in the following way
(servletName).methodName(String URL){
response.sendRedirect(URL); // Where do I get the response object
from?
}
I cannot pass it as a parameter of the method because another class is
calling it. I dont know of any way to "create" a response object.
Cheers,
Shaji B
-----Original Message-----
From: Abhay [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 08, 2000 9:38 AM
To: [EMAIL PROTECTED]
Subject: Re: How to call a servlet from a class?
Hi Shaji !
You can directly use the method as (servletName).(methodName() ) if
it's a static method. Or Else u can use the default constructor with no
parameters for the servlet as :
(servletName) abc = new (servletName) ;
String pqr = abc.(methodName(String xyz, int lmn));
It's not necessary to define such a constructure in the servlet since it's
the default constructor of any class.
Abhay
___________________________________________________________________________
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
___________________________________________________________________________
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