It might help you. Thanks for all your replies. I'm building a web site - much as Jeff described - and trying to keep it as modular as possible.
My understanding is something like this then David Kago. Try using tiles - very effective and can give you the modular results you are looking for. Hope this helps and not confuses. As far as I know, In terms of performance, Standard include action would be better than directive include.
Bear Bibeault. Probably not. After copying translation is performed for the current page. Simply saying it is static instruction to jsp engine ie. Java Revisited. It will affect for example the path you gonna have to specify for your included file. A little research on Google will tell you more. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams?
Collectives on Stack Overflow. Learn more. Asked 10 years, 2 months ago. Active 1 year ago. Viewed k times. Prasoon Prasoon 1, 4 4 gold badges 13 13 silver badges 10 10 bronze badges. Add a comment. Active Oldest Votes. Resources included by include directive are loaded during jsp translation time, while resources included by include action are loaded during request time. Any change on included resources will not be visible in case of include directive until jsp file compiles again.
While in case of include action, any change in included resource will be visible in the next request. Include directive uses file attribute to specify resources to be included while include action uses page attribute for the same purpose. HOW TO? Scripting elements : These are Java coding elements such as declarations, expressions, scriptlets, and comments. Objects and scopes : JSP objects can be created either explicitly or implicitly and are accessible within a given scope, such as from anywhere in the JSP page or the session.
Actions : These create objects or affect the output stream in the JSP response or both. Regarding your Edit Maybe in your example in your "Edit" paragraph , there is no difference between using direct include and a Tag File. They can Be customized by means of attributes passed from the calling page. Pass variables back to the calling page. Access all the objects available to JSP pages. Be nested within one another and communicate by means of private variables.
Useful reading. Difference between include directive and include action in JSP JSP tricks to make templating easier Very informative and easy to understand tutorial from coreservlet. As for the including content in JSP quote from here : Use the include directive if the file changes rarely. Use the include action only for content that changes often , and if which page to include cannot be decided until the main page is requested. Only one servlet is executed at run time.
Scriptlet variables declared in the parent page can be accessed in the included page remember, they are the same page. The JSP include directive and action tags are two different types for translate the JSP codes into the JSP containers we can add all other extension files in the single web page for work in the navigation for web applications. This is a guide to JSP Include. Here we discuss an introduction to JSP Include with appropriate syntax, working and examples to implement.
You can also go through our other related articles to learn more —.
0コメント