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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the life-cycle methods for a jsp?

697


What are the literals used in jsp?

794


When i am useing useBean tag of JSP in weblogic server It show compiletion error..Like bad class file: C:\bea\user_projects\domains\Mahesh\applications\UseBean\WEB-INF\classes\user\UserData.class class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. user.UserData user1 = null; //[ /SaveName.jsp; Line: 4]

1923


Give uses of object cloning?

735


What is the _jspservice() method?

717


Which language is used to write servlets and jsp?

648


How is jsp better than servlet technology?

754


What is jsp? Explain

712


What is the default value of session attribute in jsp?

629


What is the page directive is used to prevent a jsp page from automatically creating a session?

741


How many jsp implicit objects are there?

709


What is the purpose of jsp?

749


Which is better jsp or javascript?

673


How did you implement caching in jsp?

848


How does error handling occur with jstl?

706