Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

question on JSP directive

 
Vanchi Nathan
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I ve a question on JSP directives.

I am using a Include JSP directive to include a page "copyrights.jsp". The changes in the copyrights.jsp page immediately reflects during the run time, why?


thanks in adv..
[ August 30, 2005: Message edited by: Bear Bibeault ]
 
Shrinivas Mujumdar
Ranch Hand
Posts: 328
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Vanchi,
I guess it is because of dependency of your JSP on copyrights.jsp. JSP engine has considered your JSp & copyrights.jsp as a translation unit & as timestamp of one of the entity has changed JSP engine has retranslated entitr unit one more time so you are getting updated one.

Shrinivas
 
Vanchi Nathan
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Shrinivas,

Thanks for the reply,

I suppose this sought of refresh could only be done by the JSP action tag, because the include action tag does the updation of the JSP page during the run time.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This used to be the case.
Many servers now check the timestamp on included JSPs and will re-generate and re-compile underlying servlet if they get updated.
 
Vanchi Nathan
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ben,

Just to clarify, then what is the difference between using an include directive than a JSP action tag ?

Thanks,
 
David Ulicny
Ranch Hand
Posts: 724
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Includes the file, it is compiled into result servlet.



Includes the response of the included page, not the page itself.
 
Vanchi Nathan
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi david,

can i say that when 'include' directive is used there is only one servlet that serves the request and when 'include' Jsp action tag is used there are individual servlets for every action tag to server the request..

thanks
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
 
Shrinivas Mujumdar
Ranch Hand
Posts: 328
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello David,Vanchi

I don't think so in generated servelt there will be a pointer kind of information about from which page response should be included & as servlet is multithreaded there is no need to have different servlet instances for include action tag.


Shrinivas
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Shrinivas Mujumdar:
Hello David,Vanchi

I don't think so in generated servelt there will be a pointer kind of information about from which page response should be included & as servlet is multithreaded there is no need to have different servlet instances for include action tag.
Shrinivas


Each of the JSPs (the parent and included page) will result in it's own generated servlet class.
The two will be executed at run time and their output merged.

With the include directive <%@... the sourc of the two JSPs will be combined when generating the servlet code and only one servlet class will result.
 
Bob wang
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Amarender Reddy
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[Bear edit: removed 'me too' response which not only was superfluous, but incorrect.]
[ September 03, 2005: Message edited by: Bear Bibeault ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic