What's the difference between an import and include directive,
and also the difference between include directive and
include action?



What's the difference between an import and include directive, and also the difference between..

Answer / vasanth

import directive is used to import any java classes into the jsp. eg : import java.lang.String, whereas include directive is used to include a content of another jsp.

'include' directive is used to include content from a jsp which is static for ever once the jspServlet created for it. The include jsp will not compipled each and every time it gets loaded Header and footer jsps can be included in this method.

If any jsp is included thru include action, the content of the jsp will be compiled and the respective output will be generated and rendered to the including jsp each and every time the including jsp is getting loaded.

Is This Answer Correct ?    23 Yes 4 No

Post New Answer

More JSP Interview Questions

What are the directives in jsp?

0 Answers  


What are the attributes of page directive?

0 Answers  


What is a jsp directive?

0 Answers  


What are scripting elements?

0 Answers  


Explain jsp lifecycle methods?

0 Answers  






How to use jsp el to get http method name?

0 Answers  


What is the need for jsp?

0 Answers  


What is the major difference between servletcontext and pagecontext?

0 Answers  


How do I save a jsp file?

0 Answers  


What are implicit objects?

9 Answers  


Can we use jsp implicit objects in a method defined in jsp declaration?

0 Answers  


How to access java variable in jsp?

0 Answers  


Categories