• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Should I know how JSPs convert to servlet?

 
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ranchers,
I think the topic of how JSPs convert to servlet is a background mechanism of JSP which programmers need not to consider in actual work. So need I know it to fit this certification?
Regards.
 
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need not know the internals for how a container converts JSP to a servlet. But you need to have an understanding of where and how the scriplets and expressions used in JSP fit into the servlet after translation. This is imp as based on these, the behaviour of the page changes.

Example:
If I have


The String name becomes an instance variable of servlet after conversion and hence not thread safe.

But if I update the above code to:


The String name becomes a member variable. Now it is thread safe.

This is the kind of understanding of JSP to servlet conversion one should have. Of course, I have just given one example. There are more to it which any study guide would touch upon.
 
Zhixiong Pan
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sunil,
Thanks for your reply.
One question:
What's the difference between an instance variable of servlet and member variable?
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
He means :
an instance variable of servlet : a member of the servlet class
a member variable : a variable local to the function
 
grapes are vegan food pellets. Eat this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic