My question is :
If I want to start my counter(see code below) with a default value (say 1122)
then if i use constructor of
my servlet to do this, what is wrong with the code?why cant i use construtor
in this way in servlets?
import java.io.*;
import javax.servlet.http.*;
import javax.servlet.*;
public class CounterCons extends HttpServlet
{
int count;
CounterCons(int i)
{
count=i;
}
public void doGet(HttpServletRequest req,HttpServletResponse res) throws
IOException
{
new CounterCons(1122);
PrintWriter out=res.getWriter();
count++;
out.println(count);
}
}
"T.A. Flores" <[EMAIL PROTECTED]> wrote:
So what exactly is your question?
----- Original Message -----
From: balwinder singh <[EMAIL PROTECTED]>
Date: Friday, April 20, 2001 2:03 pm
Subject: Servlets constructors
> Hi
> I am new to Servlets and a lil curious about this question:
>
> The problem is:
>
> In JDK1.1 servlet Constructor were not allowed.But are they
> allowed in
> JDK1.3?
> If no,then why not? and if yes then pls give an example.
> Regards
> Balwinder Singh
> web developer
>
>
> ____________________________________________________________________
> Get free email and a permanent address at
> http://www.netaddress.com/?N=1
>
________________________________________________________________________
___
> To unsubscribe, send email to [EMAIL PROTECTED] and include in
> the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http:
> Resources: http://java.sun.com/products/servlet/external-
> resources.htmlLISTSERV 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
____________________________________________________________________
Get free email and a permanent address at http://www.netaddress.com/?N=1
___________________________________________________________________________
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