File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Should I know how JSPs convert to servlet? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Should I know how JSPs convert to servlet?" Watch "Should I know how JSPs convert to servlet?" New topic
Author

Should I know how JSPs convert to servlet?

Zhixiong Pan
Ranch Hand

Joined: Jan 25, 2006
Posts: 239
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.


SCJP 1.4 SCJD
Sunil Vasudevan
Ranch Hand

Joined: Mar 05, 2007
Posts: 107
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.


Sunil.V<br />SCJP2, SCWCD1.4, SCBCD1.3
Zhixiong Pan
Ranch Hand

Joined: Jan 25, 2006
Posts: 239
Hi Sunil,
Thanks for your reply.
One question:
What's the difference between an instance variable of servlet and member variable?
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

He means :
an instance variable of servlet : a member of the servlet class
a member variable : a variable local to the function


[My Blog]
All roads lead to JavaRanch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Should I know how JSPs convert to servlet?