• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

static variables ?

 
Ranch Hand
Posts: 318
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:
 
Author
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 318
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
vow
this one was like a gotcha !
 
sunglasses are a type of coolness prosthetic. Check out the sunglasses on this tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic