Re: how to use global variable?

2002-05-13 Thread [Vaishali S. Pandya]

thanks to  Bhushan and ss
but i had tried it also before mail u but i got some other errors
can u please try to solve this and mail me the code?
can i use static variables in recursion?
as my v will be increased in each call of fact(), can i take it static?
and what does it mean by static function and nonstatic function?
pls explain and if possible try this code and give me a running code
pleaassee
because i need it urgently as i want to use this recursion in my other
program.

ThankX in advance
Vaishali



inside static method u cannot call a non-static variable.
make the variable static...

s.subramanian
IonIdea Enterprise Solutions
Bangalore

- Original Message -
From: [Vaishali S. Pandya] [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, May 13, 2002 10:40 AM
Subject: Re: how to use global variable?


 Can't make a static reference to nonstatic variable myval

 this is the error i get in this code

 HTML
 HEAD
 TITLE Factorial /TITLE
 /HEAD
 BODY
 %!
  int myval[]= new int[100];
  int v=0;
 %
 %
  int a=0;
  out.println(v);
  for (a=0;av;a++){
   out.println(myval[a]);
  }
  out.println(fact(5));
 %
 %!
  public static int fact(int i){
   myval[v++] = i;
   if (i==1){
return i;
   }
   return i*fact(i-1);
  }
 %
 /BODY
 /HTML



 By defining the variable like this

 %!
 file://declare global variable here
 %

 -Original Message-
 From: [Vaishali S. Pandya] [mailto:[EMAIL PROTECTED]]
 Sent: Monday, May 13, 2002 10:12 AM
 To: [EMAIL PROTECTED]
 Subject: how to use global variable?


 hello all
 good morning
 as my prev que,
 i tried to use function and not able to use out.println in function
 so now i want to use a global array and want to add all values in array
and
 will print that array in main code
 but i don't know how to make an array global.

 see the code

 HTML
 HEAD
 TITLE Factorial /TITLE
 /HEAD
 BODY
 %!
  public static int fact(int i){
 //System.out.println(i);
   myval[v++] = i;
   if (i==1){
return i;
   }
   return i*fact(i-1);
  }
 %
 %
  for(a=0;av;a++)
   out.println(myval[a]);
  out.println(fact(5));
 %
 /BODY
 /HTML

 here array myval and int v must be global so i can use it in main code as
 well as in function
 how?

 ThankX
 Vaishali
 Reliance Ind Ltd
 Ahmedabad


===
 To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff
JSP-INTEREST.
 For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST
DIGEST.
 Some relevant FAQs on JSP/Servlets can be found at:

  http://archives.java.sun.com/jsp-interest.html
  http://java.sun.com/products/jsp/faq.html
  http://www.esperanto.org.nz/jsp/jspfaq.jsp
  http://www.jguru.com/faq/index.jsp
  http://www.jspinsider.com

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff
JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST
DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com



Re: how to use global variable?

2002-05-13 Thread Joseph Ottinger

Um... pardon my ignorance, but I'm failing to see the real problem here. You
defined a function, but the JSP page's out variable isn't available to it;
well, uh, why don't you pass the output stream to the function and use it?

%!
void myFunc(Writer out) {
   out.println(This will show up in your page now. AMAZING.);
}
%

This isn't rocket science; just Java.


From: Bhushan_Bhangale [EMAIL PROTECTED]
Reply-To: A mailing list about Java Server Pages specification and
reference [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: how to use global variable?
Date: Mon, 13 May 2002 10:36:15 +0530

By defining the variable like this

%!
//declare global variable here
%

-Original Message-
From: [Vaishali S. Pandya] [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 13, 2002 10:12 AM
To: [EMAIL PROTECTED]
Subject: how to use global variable?


hello all
good morning
as my prev que,
i tried to use function and not able to use out.println in function
so now i want to use a global array and want to add all values in array and
will print that array in main code
but i don't know how to make an array global.

see the code

HTML
HEAD
TITLE Factorial /TITLE
/HEAD
BODY
%!
  public static int fact(int i){
//System.out.println(i);
   myval[v++] = i;
   if (i==1){
return i;
   }
   return i*fact(i-1);
  }
%
%
  for(a=0;av;a++)
   out.println(myval[a]);
  out.println(fact(5));
%
/BODY
/HTML

here array myval and int v must be global so i can use it in main code as
well as in function
how?

ThankX
Vaishali
Reliance Ind Ltd
Ahmedabad

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff
JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST
DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

  http://archives.java.sun.com/jsp-interest.html
  http://java.sun.com/products/jsp/faq.html
  http://www.esperanto.org.nz/jsp/jspfaq.jsp
  http://www.jguru.com/faq/index.jsp
  http://www.jspinsider.com

==To
unsubscribe: mailto [EMAIL PROTECTED] with body: signoff
JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST
DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

  http://archives.java.sun.com/jsp-interest.html
  http://java.sun.com/products/jsp/faq.html
  http://www.esperanto.org.nz/jsp/jspfaq.jsp
  http://www.jguru.com/faq/index.jsp
  http://www.jspinsider.com




---
Joseph B. Ottinger   [EMAIL PROTECTED]
http://enigmastation.com  IT Consultant


_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com



Re: how to use global variable?

2002-05-13 Thread Jagan K Samuel

Hi

I have an application developed in Tomcat which is to be hosted in a
production environment.
But when hosted Tomcat crashes often giving Hot Spot Error.

This is the error i get

[jk_ajp13_worker.c (325)]: Error ajp13_process_callback - write failed
[jk_ajp13_worker.c (203)]: connection_tcp_get_message: Error -
jk_tcp_socket_recvfull failed
[jk_ajp13_worker.c (621)]: Error reading request
[jk_ajp13_worker.c (203)]: connection_tcp_get_message: Error -
jk_tcp_socket_recvfull failed
[jk_ajp13_worker.c (621)]: Error reading request
[jk_connect.c (143)]: jk_open_socket, connect() failed errno = 61
[jk_ajp13_worker.c (173)]: In jk_endpoint_t::connect_to_tomcat, failed
errno = 61
[jk_ajp13_worker.c (586)]: Error connecting to the Tomcat process.


Anyone knows the reason for this. Or could anyone suggest better
servers which could be reliable to be hosted in
production?

With Best Regards
Jagan K Samuel

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com



Re: how to use global variable?

2002-05-13 Thread vijay

declare it in %! StringArray[] str = new StringArray[10] % tag..

thanks  regards
vijayanand.R

(),,,()
   ( (.  .) .-''-.
  (o  ) ) ('o'   )
=(,,)=(,,)=(,,)==(,,)=
- Original Message -
From: [Vaishali S. Pandya] [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, May 13, 2002 10:11 AM
Subject: how to use global variable?


hello all
good morning
as my prev que,
i tried to use function and not able to use out.println in function
so now i want to use a global array and want to add all values in array and
will print that array in main code
but i don't know how to make an array global.

see the code

HTML
HEAD
TITLE Factorial /TITLE
/HEAD
BODY
%!
 public static int fact(int i){
//System.out.println(i);
  myval[v++] = i;
  if (i==1){
   return i;
  }
  return i*fact(i-1);
 }
%
%
 for(a=0;av;a++)
  out.println(myval[a]);
 out.println(fact(5));
%
/BODY
/HTML

here array myval and int v must be global so i can use it in main code as
well as in function
how?

ThankX
Vaishali
Reliance Ind Ltd
Ahmedabad

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff
JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST
DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com



Re: how to use global variable?

2002-05-13 Thread [Vaishali S. Pandya]

Thanks joseph
but what to import for Writer class?
it gives class Writer not found

Vaishali


Um... pardon my ignorance, but I'm failing to see the real problem here.
You
defined a function, but the JSP page's out variable isn't available to
it;
well, uh, why don't you pass the output stream to the function and use it?

%!
void myFunc(Writer out) {
   out.println(This will show up in your page now. AMAZING.);
}
%

This isn't rocket science; just Java.


From: Bhushan_Bhangale [EMAIL PROTECTED]
Reply-To: A mailing list about Java Server Pages specification and
reference [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: how to use global variable?
Date: Mon, 13 May 2002 10:36:15 +0530

By defining the variable like this

%!
//declare global variable here
%

-Original Message-
From: [Vaishali S. Pandya] [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 13, 2002 10:12 AM
To: [EMAIL PROTECTED]
Subject: how to use global variable?


hello all
good morning
as my prev que,
i tried to use function and not able to use out.println in function
so now i want to use a global array and want to add all values in array
and
will print that array in main code
but i don't know how to make an array global.

see the code

HTML
HEAD
TITLE Factorial /TITLE
/HEAD
BODY
%!
  public static int fact(int i){
//System.out.println(i);
   myval[v++] = i;
   if (i==1){
return i;
   }
   return i*fact(i-1);
  }
%
%
  for(a=0;av;a++)
   out.println(myval[a]);
  out.println(fact(5));
%
/BODY
/HTML

here array myval and int v must be global so i can use it in main code as
well as in function
how?

ThankX
Vaishali
Reliance Ind Ltd
Ahmedabad


===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff
JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST
DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

  http://archives.java.sun.com/jsp-interest.html
  http://java.sun.com/products/jsp/faq.html
  http://www.esperanto.org.nz/jsp/jspfaq.jsp
  http://www.jguru.com/faq/index.jsp
  http://www.jspinsider.com


==To

unsubscribe: mailto [EMAIL PROTECTED] with body: signoff
JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST
DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

  http://archives.java.sun.com/jsp-interest.html
  http://java.sun.com/products/jsp/faq.html
  http://www.esperanto.org.nz/jsp/jspfaq.jsp
  http://www.jguru.com/faq/index.jsp
  http://www.jspinsider.com




---
Joseph B. Ottinger   [EMAIL PROTECTED]
http://enigmastation.com  IT Consultant


_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff
JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST
DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com



Re: how to use global variable?

2002-05-13 Thread Chen, Gin

java.io
output and input classes are usually in java.io
you can use PrintWriter to be more specific with what JSPs use.
-Tim

-Original Message-
From: [Vaishali S. Pandya] [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 13, 2002 6:31 AM
To: [EMAIL PROTECTED]
Subject: Re: how to use global variable?


Thanks joseph
but what to import for Writer class?
it gives class Writer not found

Vaishali


Um... pardon my ignorance, but I'm failing to see the real problem here.
You
defined a function, but the JSP page's out variable isn't available to
it;
well, uh, why don't you pass the output stream to the function and use it?

%!
void myFunc(Writer out) {
   out.println(This will show up in your page now. AMAZING.);
}
%

This isn't rocket science; just Java.


From: Bhushan_Bhangale [EMAIL PROTECTED]
Reply-To: A mailing list about Java Server Pages specification and
reference [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: how to use global variable?
Date: Mon, 13 May 2002 10:36:15 +0530

By defining the variable like this

%!
//declare global variable here
%

-Original Message-
From: [Vaishali S. Pandya] [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 13, 2002 10:12 AM
To: [EMAIL PROTECTED]
Subject: how to use global variable?


hello all
good morning
as my prev que,
i tried to use function and not able to use out.println in function
so now i want to use a global array and want to add all values in array
and
will print that array in main code
but i don't know how to make an array global.

see the code

HTML
HEAD
TITLE Factorial /TITLE
/HEAD
BODY
%!
  public static int fact(int i){
//System.out.println(i);
   myval[v++] = i;
   if (i==1){
return i;
   }
   return i*fact(i-1);
  }
%
%
  for(a=0;av;a++)
   out.println(myval[a]);
  out.println(fact(5));
%
/BODY
/HTML

here array myval and int v must be global so i can use it in main code as
well as in function
how?

ThankX
Vaishali
Reliance Ind Ltd
Ahmedabad


===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff
JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST
DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

  http://archives.java.sun.com/jsp-interest.html
  http://java.sun.com/products/jsp/faq.html
  http://www.esperanto.org.nz/jsp/jspfaq.jsp
  http://www.jguru.com/faq/index.jsp
  http://www.jspinsider.com


==To

unsubscribe: mailto [EMAIL PROTECTED] with body: signoff
JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST
DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

  http://archives.java.sun.com/jsp-interest.html
  http://java.sun.com/products/jsp/faq.html
  http://www.esperanto.org.nz/jsp/jspfaq.jsp
  http://www.jguru.com/faq/index.jsp
  http://www.jspinsider.com




---
Joseph B. Ottinger   [EMAIL PROTECTED]
http://enigmastation.com  IT Consultant


_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff
JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST
DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff
JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST
DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com



Re: how to use global variable?

2002-05-13 Thread Joseph Ottinger

You know... the Writer, from java.io.*, in the standard library. The docs
for Java are publicly available. You should check them out?


From: [Vaishali S. Pandya] [EMAIL PROTECTED]
Reply-To: A mailing list about Java Server Pages specification and
reference [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: how to use global variable?
Date: Mon, 13 May 2002 16:01:13 +0530

Thanks joseph
but what to import for Writer class?
it gives class Writer not found

Vaishali


Um... pardon my ignorance, but I'm failing to see the real problem here.
You
defined a function, but the JSP page's out variable isn't available to
it;
well, uh, why don't you pass the output stream to the function and use it?

%!
void myFunc(Writer out) {
out.println(This will show up in your page now. AMAZING.);
}
%

This isn't rocket science; just Java.


 From: Bhushan_Bhangale [EMAIL PROTECTED]
 Reply-To: A mailing list about Java Server Pages specification and
 reference [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: Re: how to use global variable?
 Date: Mon, 13 May 2002 10:36:15 +0530
 
 By defining the variable like this
 
 %!
 //declare global variable here
 %
 
 -Original Message-
 From: [Vaishali S. Pandya] [mailto:[EMAIL PROTECTED]]
 Sent: Monday, May 13, 2002 10:12 AM
 To: [EMAIL PROTECTED]
 Subject: how to use global variable?
 
 
 hello all
 good morning
 as my prev que,
 i tried to use function and not able to use out.println in function
 so now i want to use a global array and want to add all values in array
and
 will print that array in main code
 but i don't know how to make an array global.
 
 see the code
 
 HTML
 HEAD
 TITLE Factorial /TITLE
 /HEAD
 BODY
 %!
   public static int fact(int i){
 //System.out.println(i);
myval[v++] = i;
if (i==1){
 return i;
}
return i*fact(i-1);
   }
 %
 %
   for(a=0;av;a++)
out.println(myval[a]);
   out.println(fact(5));
 %
 /BODY
 /HTML
 
 here array myval and int v must be global so i can use it in main code as
 well as in function
 how?
 
 ThankX
 Vaishali
 Reliance Ind Ltd
 Ahmedabad
 
 
===
 To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff
 JSP-INTEREST.
 For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST
 DIGEST.
 Some relevant FAQs on JSP/Servlets can be found at:
 
   http://archives.java.sun.com/jsp-interest.html
   http://java.sun.com/products/jsp/faq.html
   http://www.esperanto.org.nz/jsp/jspfaq.jsp
   http://www.jguru.com/faq/index.jsp
   http://www.jspinsider.com
 
 
==To

 unsubscribe: mailto [EMAIL PROTECTED] with body: signoff
 JSP-INTEREST.
 For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST
 DIGEST.
 Some relevant FAQs on JSP/Servlets can be found at:
 
   http://archives.java.sun.com/jsp-interest.html
   http://java.sun.com/products/jsp/faq.html
   http://www.esperanto.org.nz/jsp/jspfaq.jsp
   http://www.jguru.com/faq/index.jsp
   http://www.jspinsider.com




---
Joseph B. Ottinger   [EMAIL PROTECTED]
http://enigmastation.com  IT Consultant


_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff
JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST
DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

  http://archives.java.sun.com/jsp-interest.html
  http://java.sun.com/products/jsp/faq.html
  http://www.esperanto.org.nz/jsp/jspfaq.jsp
  http://www.jguru.com/faq/index.jsp
  http://www.jspinsider.com

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff
JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST
DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

  http://archives.java.sun.com/jsp-interest.html
  http://java.sun.com/products/jsp/faq.html
  http://www.esperanto.org.nz/jsp/jspfaq.jsp
  http://www.jguru.com/faq/index.jsp
  http://www.jspinsider.com


_
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http

how to use global variable?

2002-05-12 Thread [Vaishali S. Pandya]

hello all
good morning
as my prev que,
i tried to use function and not able to use out.println in function
so now i want to use a global array and want to add all values in array and
will print that array in main code
but i don't know how to make an array global.

see the code

HTML
HEAD
TITLE Factorial /TITLE
/HEAD
BODY
%!
 public static int fact(int i){
//System.out.println(i);
  myval[v++] = i;
  if (i==1){
   return i;
  }
  return i*fact(i-1);
 }
%
%
 for(a=0;av;a++)
  out.println(myval[a]);
 out.println(fact(5));
%
/BODY
/HTML

here array myval and int v must be global so i can use it in main code as
well as in function
how?

ThankX
Vaishali
Reliance Ind Ltd
Ahmedabad

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com



Re: how to use global variable?

2002-05-12 Thread Bhushan_Bhangale

By defining the variable like this

%!
//declare global variable here
%

-Original Message-
From: [Vaishali S. Pandya] [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 13, 2002 10:12 AM
To: [EMAIL PROTECTED]
Subject: how to use global variable?


hello all
good morning
as my prev que,
i tried to use function and not able to use out.println in function
so now i want to use a global array and want to add all values in array and
will print that array in main code
but i don't know how to make an array global.

see the code

HTML
HEAD
TITLE Factorial /TITLE
/HEAD
BODY
%!
 public static int fact(int i){
//System.out.println(i);
  myval[v++] = i;
  if (i==1){
   return i;
  }
  return i*fact(i-1);
 }
%
%
 for(a=0;av;a++)
  out.println(myval[a]);
 out.println(fact(5));
%
/BODY
/HTML

here array myval and int v must be global so i can use it in main code as
well as in function
how?

ThankX
Vaishali
Reliance Ind Ltd
Ahmedabad

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

==To 
unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com



Re: how to use global variable?

2002-05-12 Thread Kesav, Ramesh

just declare these varibales within the tag % %
say after your head tag.

Regards

Ramesh Kesavanarayanan
[EMAIL PROTECTED]
 -Original Message-
 From: [Vaishali S. Pandya] [SMTP:[EMAIL PROTECTED]]
 Sent: Monday, May 13, 2002 10:12 AM
 To:   [EMAIL PROTECTED]
 Subject:  how to use global variable?

 hello all
 good morning
 as my prev que,
 i tried to use function and not able to use out.println in function
 so now i want to use a global array and want to add all values in array
 and
 will print that array in main code
 but i don't know how to make an array global.

 see the code

 HTML
 HEAD
 TITLE Factorial /TITLE
 /HEAD
 BODY
 %!
  public static int fact(int i){
 //System.out.println(i);
   myval[v++] = i;
   if (i==1){
return i;
   }
   return i*fact(i-1);
  }
 %
 %
  for(a=0;av;a++)
   out.println(myval[a]);
  out.println(fact(5));
 %
 /BODY
 /HTML

 here array myval and int v must be global so i can use it in main code as
 well as in function
 how?

 ThankX
 Vaishali
 Reliance Ind Ltd
 Ahmedabad

 ==
 =
 To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff
 JSP-INTEREST.
 For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST
 DIGEST.
 Some relevant FAQs on JSP/Servlets can be found at:

  http://archives.java.sun.com/jsp-interest.html
  http://java.sun.com/products/jsp/faq.html
  http://www.esperanto.org.nz/jsp/jspfaq.jsp
  http://www.jguru.com/faq/index.jsp
  http://www.jspinsider.com

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com



Re: how to use global variable?

2002-05-12 Thread [Vaishali S. Pandya]

Can't make a static reference to nonstatic variable myval

this is the error i get in this code

HTML
HEAD
TITLE Factorial /TITLE
/HEAD
BODY
%!
 int myval[]= new int[100];
 int v=0;
%
%
 int a=0;
 out.println(v);
 for (a=0;av;a++){
  out.println(myval[a]);
 }
 out.println(fact(5));
%
%!
 public static int fact(int i){
  myval[v++] = i;
  if (i==1){
   return i;
  }
  return i*fact(i-1);
 }
%
/BODY
/HTML



By defining the variable like this

%!
//declare global variable here
%

-Original Message-
From: [Vaishali S. Pandya] [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 13, 2002 10:12 AM
To: [EMAIL PROTECTED]
Subject: how to use global variable?


hello all
good morning
as my prev que,
i tried to use function and not able to use out.println in function
so now i want to use a global array and want to add all values in array and
will print that array in main code
but i don't know how to make an array global.

see the code

HTML
HEAD
TITLE Factorial /TITLE
/HEAD
BODY
%!
 public static int fact(int i){
//System.out.println(i);
  myval[v++] = i;
  if (i==1){
   return i;
  }
  return i*fact(i-1);
 }
%
%
 for(a=0;av;a++)
  out.println(myval[a]);
 out.println(fact(5));
%
/BODY
/HTML

here array myval and int v must be global so i can use it in main code as
well as in function
how?

ThankX
Vaishali
Reliance Ind Ltd
Ahmedabad

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com



Re: how to use global variable?

2002-05-12 Thread [Vaishali S. Pandya]

No,
in % % will not be global
it will give undefined variable error while using them
u have to use %!  % tag to declare global var

Vaishali
RIL
Ahmedabad



just declare these varibales within the tag % %
say after your head tag.

Regards

Ramesh Kesavanarayanan
[EMAIL PROTECTED]
 -Original Message-
 From: [Vaishali S. Pandya] [SMTP:[EMAIL PROTECTED]]
 Sent: Monday, May 13, 2002 10:12 AM
 To:   [EMAIL PROTECTED]
 Subject:  how to use global variable?

 hello all
 good morning
 as my prev que,
 i tried to use function and not able to use out.println in function
 so now i want to use a global array and want to add all values in array
 and
 will print that array in main code
 but i don't know how to make an array global.

 see the code

 HTML
 HEAD
 TITLE Factorial /TITLE
 /HEAD
 BODY
 %!
  public static int fact(int i){
 //System.out.println(i);
   myval[v++] = i;
   if (i==1){
return i;
   }
   return i*fact(i-1);
  }
 %
 %
  for(a=0;av;a++)
   out.println(myval[a]);
  out.println(fact(5));
 %
 /BODY
 /HTML

 here array myval and int v must be global so i can use it in main code as
 well as in function
 how?

 ThankX
 Vaishali
 Reliance Ind Ltd
 Ahmedabad


==
 =
 To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff
 JSP-INTEREST.
 For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST
 DIGEST.
 Some relevant FAQs on JSP/Servlets can be found at:

  http://archives.java.sun.com/jsp-interest.html
  http://java.sun.com/products/jsp/faq.html
  http://www.esperanto.org.nz/jsp/jspfaq.jsp
  http://www.jguru.com/faq/index.jsp
  http://www.jspinsider.com

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff
JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST
DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com



Re: how to use global variable?

2002-05-12 Thread Bhushan_Bhangale

You have declared the method as static and the variable is a nonstatic one. Either 
declare the variable as static or make the method nonstatic.

-Original Message-
From: [Vaishali S. Pandya] [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 13, 2002 10:40 AM
To: [EMAIL PROTECTED]
Subject: Re: how to use global variable?


Can't make a static reference to nonstatic variable myval

this is the error i get in this code

HTML
HEAD
TITLE Factorial /TITLE
/HEAD
BODY
%!
 int myval[]= new int[100];
 int v=0;
%
%
 int a=0;
 out.println(v);
 for (a=0;av;a++){
  out.println(myval[a]);
 }
 out.println(fact(5));
%
%!
 public static int fact(int i){
  myval[v++] = i;
  if (i==1){
   return i;
  }
  return i*fact(i-1);
 }
%
/BODY
/HTML



By defining the variable like this

%!
//declare global variable here
%

-Original Message-
From: [Vaishali S. Pandya] [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 13, 2002 10:12 AM
To: [EMAIL PROTECTED]
Subject: how to use global variable?


hello all
good morning
as my prev que,
i tried to use function and not able to use out.println in function
so now i want to use a global array and want to add all values in array and
will print that array in main code
but i don't know how to make an array global.

see the code

HTML
HEAD
TITLE Factorial /TITLE
/HEAD
BODY
%!
 public static int fact(int i){
//System.out.println(i);
  myval[v++] = i;
  if (i==1){
   return i;
  }
  return i*fact(i-1);
 }
%
%
 for(a=0;av;a++)
  out.println(myval[a]);
 out.println(fact(5));
%
/BODY
/HTML

here array myval and int v must be global so i can use it in main code as
well as in function
how?

ThankX
Vaishali
Reliance Ind Ltd
Ahmedabad

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

==To 
unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com



Re: how to use global variable?

2002-05-12 Thread subbu

inside static method u cannot call a non-static variable.
make the variable static...

s.subramanian
IonIdea Enterprise Solutions
Bangalore

- Original Message -
From: [Vaishali S. Pandya] [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, May 13, 2002 10:40 AM
Subject: Re: how to use global variable?


 Can't make a static reference to nonstatic variable myval

 this is the error i get in this code

 HTML
 HEAD
 TITLE Factorial /TITLE
 /HEAD
 BODY
 %!
  int myval[]= new int[100];
  int v=0;
 %
 %
  int a=0;
  out.println(v);
  for (a=0;av;a++){
   out.println(myval[a]);
  }
  out.println(fact(5));
 %
 %!
  public static int fact(int i){
   myval[v++] = i;
   if (i==1){
return i;
   }
   return i*fact(i-1);
  }
 %
 /BODY
 /HTML



 By defining the variable like this

 %!
 file://declare global variable here
 %

 -Original Message-
 From: [Vaishali S. Pandya] [mailto:[EMAIL PROTECTED]]
 Sent: Monday, May 13, 2002 10:12 AM
 To: [EMAIL PROTECTED]
 Subject: how to use global variable?


 hello all
 good morning
 as my prev que,
 i tried to use function and not able to use out.println in function
 so now i want to use a global array and want to add all values in array
and
 will print that array in main code
 but i don't know how to make an array global.

 see the code

 HTML
 HEAD
 TITLE Factorial /TITLE
 /HEAD
 BODY
 %!
  public static int fact(int i){
 //System.out.println(i);
   myval[v++] = i;
   if (i==1){
return i;
   }
   return i*fact(i-1);
  }
 %
 %
  for(a=0;av;a++)
   out.println(myval[a]);
  out.println(fact(5));
 %
 /BODY
 /HTML

 here array myval and int v must be global so i can use it in main code as
 well as in function
 how?

 ThankX
 Vaishali
 Reliance Ind Ltd
 Ahmedabad


===
 To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff
JSP-INTEREST.
 For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST
DIGEST.
 Some relevant FAQs on JSP/Servlets can be found at:

  http://archives.java.sun.com/jsp-interest.html
  http://java.sun.com/products/jsp/faq.html
  http://www.esperanto.org.nz/jsp/jspfaq.jsp
  http://www.jguru.com/faq/index.jsp
  http://www.jspinsider.com

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST.
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com