aspose file tools*
The moose likes JSP and the fly likes Page 156 in Sample Chapter of JavaSrver Pages Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Page 156 in Sample Chapter of JavaSrver Pages" Watch "Page 156 in Sample Chapter of JavaSrver Pages" New topic
Author

Page 156 in Sample Chapter of JavaSrver Pages

Ko Ko Naing
Ranch Hand

Joined: Jun 08, 2002
Posts: 3178
Also when I took the SCWCD 1.4 Beta Exam, I saw this point... But it's not a big deal with the exam, so I ignore it...
In the last paragraph of the Page 156 in the chapter-11 of the book said the following...

You can therefore implement the actions as tag files initially (because it�s easier) and convert them to Java classes later (maybe to gain better performance) without having to make any changes in the JSP pages that use them.

Does it mean that Classic Tags and Simple Tags implementation are better in performance than implementation custom tags using Tag Files? I'm just wondering why... Are tag files converted to the Java classes behind the scenes in the app serv? Or is it used as it is?
Mr. Bergsten, could you please explain a bit on this issue? I cannot stand asking you this question, since I was preparing for the exam... And u r here and it's very great that we have you here answering our doubts in your book... Thanks..


Co-author of SCMAD Exam Guide, Author of JMADPlus
SCJP1.2, CCNA, SCWCD1.4, SCBCD1.3, SCMAD1.0, SCJA1.0, SCJP6.0
Nicholas Cheung
Ranch Hand

Joined: Nov 07, 2003
Posts: 4982
Hi Ko Ko,
One of the reasons I think of is the pre-compliation issue.
For Classic and Simple Tags, we need to compile them before we can use them. And thus, they are already inside the memory of the container.
For tag files, like JSP, it is compiled on request. Maybe there are some ways, like JSP, that can pre-compile, but I am not sure.
Nick.


SCJP 1.2, OCP 9i DBA, SCWCD 1.3, SCJP 1.4 (SAI), SCJD 1.4, SCWCD 1.4 (Beta), ICED (IBM 287, IBM 484, IBM 486), SCMAD 1.0 (Beta), SCBCD 1.3, ICSD (IBM 288), ICDBA (IBM 700, IBM 701), SCDJWS, ICSD (IBM 348), OCP 10g DBA (Beta), SCJP 5.0 (Beta), SCJA 1.0 (Beta), MCP(70-270), SCBCD 5.0 (Beta), SCJP 6.0, SCEA for JEE5 (in progress)
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Are tag files converted to the Java classes behind the scenes in the app serv?

Yes, they are.


Groovy
Hans Bergsten
Author
Ranch Hand

Joined: Dec 01, 2003
Posts: 106
Originally posted by Ko Ko Naing:
Also when I took the SCWCD 1.4 Beta Exam, I saw this point... But it's not a big deal with the exam, so I ignore it...
In the last paragraph of the Page 156 in the chapter-11 of the book said the following...

Does it mean that Classic Tags and Simple Tags implementation are better in performance than implementation custom tags using Tag Files? I'm just wondering why... Are tag files converted to the Java classes behind the scenes in the app serv? Or is it used as it is?
Mr. Bergsten, could you please explain a bit on this issue? I cannot stand asking you this question, since I was preparing for the exam... And u r here and it's very great that we have you here answering our doubts in your book... Thanks..

Maybe I should have punted on that comment, because the performance difference depends a lot on which container you use; some may use various tricks to make a tag file as performant as a hand-coded Java tag handler or even better.
Anyway, what I had in mind is that a tag file typically use a number of action elements to do its job, and the Java class generated from the tag file typically include code for creating a tag handler instance and setting its properties for each such action element. In theory, a hand-coded tag handler may use tighter code, such as directly calling utility methods implemented as regular Java classes instead. If there is a performance difference at all, it should be neglible for most web applications. In general, I recommend not to think too much about performance unless you've verified with a benchmark that it's really a problem.


Hans Bergsten, hans@gefionsoftware.com<br />Author of O'Reilly's<br />- JavaServer Pages,<br />- JavaServer Faces<br /><a href="http://www.hansbergsten.com/" target="_blank" rel="nofollow">http://www.hansbergsten.com/</a>
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
Originally posted by Pradeep Bhat:

Yes, they are.

which may or may not yield efficient Java code depending on how clever the generator is.
Most are not all that clever, skipping on optimisations in favour of simplicity of design. While not a big issue normally, if a tag gets complex it may yield a significant performance penalty compared to handcoded tags.


42
Ko Ko Naing
Ranch Hand

Joined: Jun 08, 2002
Posts: 3178
Originally posted by Hans Bergsten:
In theory, a hand-coded tag handler may use tighter code, such as directly calling utility methods implemented as regular Java classes instead. If there is a performance difference at all, it should be neglible for most web applications. In general, I recommend not to think too much about performance unless you've verified with a benchmark that it's really a problem.

Is it like, in the real world web app, they usually neglect the performance issue that will come up by custom tags implementaion? I can see that, in almost all of the project that I've done in the past, we didn't care that much on tag implmentation performance issue... But, nowadays, there are many implementations of cutom tags... We might need to think about the performance issue, since there are many alternatives...
And also I can figure out that that kind of phrase in the book is making the reader to think about the performance issue, in case they might have doubt on the difference between classic tags, simple tags and tag files implementation...
Thank you very much for your explanation on it, Mr.Bergsten...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Page 156 in Sample Chapter of JavaSrver Pages