简体   繁体   中英

Automatic compilation of jsp page when using include directive

In HFSJ , it is mentioned like "the include directive is to be used for static pages". But in tomcat 5.5 (and onwards) Jasper 2 JSp engine is been used which says

Background JSP compilation - If you make a change to a JSP page which had already been compiled Jasper 2 can recompile that page in the background. The previously compiled JSP page will still be available to serve requests. Once the new page has been compiled successfully it will replace the old page. This helps improve availability of your JSP pages on a production server. Recompile JSP when included page changes - Jasper 2 can now detect when a page included at compile time from a JSP has changed and then recompile the parent JSP.

My questions are:

The second spec says that the jasper 2 will recompile the jsp. so that means translate and recompile . isnt it?

-Isnt its possible now to include the dynamic pages with include directive

A JSP can statically include another JSP using the include directive. If the book says you can only include static HTML pages, it's obviously wrong.

What it probably meant is that the directive can only include a JSP statically, and not dynamically like <jsp:include> does: you can't include a page whose path is dynamically chosen at runtime using an include directive.

You can see an include directive as a way to "copy and paste" the contents of an inner JSP inside an outer JSP. This can be useful to reuse fragments of a page (although tags are generally more flexible), or simply to break up a large page into smaller parts.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM