• Post Reply Bookmark Topic Watch Topic
  • New Topic

static variables ?

 
Kalpesh Soni
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
one more question
sorry if it is silly one, i am new in jsps
if the <%! tag has some variable is it instance variable or static variable ?
what if i want to create many instance variables and plan to use them for different invocations of jsp ?
Can I actually see the servlet that is generated?
I use weblogic
:roll:
 
Shawn Bayern
Author
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Kalpesh Soni:
one more question
sorry if it is silly one, i am new in jsps
if the <%! tag has some variable is it instance variable or static variable ?
what if i want to create many instance variables and plan to use them for different invocations of jsp ?
Can I actually see the servlet that is generated?
I use weblogic
:roll:

Code in <%! ... %> goes into the generated servlet code, outside of any particular method. So if you write
<%! String foo; %>
it's an instance variable. If you instead write
<%! static String foo; %>
it's a static variable.
 
Kalpesh Soni
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
vow
this one was like a gotcha !
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!