How many page directive we can use in a single JSP?

Answer Posted / rahul patil

We can have any number of page directive in a single jsp
page provided it should have only 'import' attribute.

e.g.
<%@ page import="beans.abc" buffer="2k"%> //1
.
.
.// some jsp page code
.
<%@ page import="beans.xyz"%> //2


if we replace line 2 with
<%@ page import="beans.xyz" buffer="4k"%> //not allowed

In short, we can use page directive many times but for
importing some other classes, not for setting other
attribute values.

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How is scripting disabled?

526


What are the advantages of jstl?

481


How can we stop errors on display in a jsp page?

516


What is jsp-config in deployment descriptor?

592


What is taglibs?

486






How do I use a scriptlet to initialize a newly instantiated bean?

548


What is the difference between include and jsp directive: include action?

533


Which one is correct order of phases in jsp life cycle?

625


How can you avoid scriptlet code in jsp?

523


What is jsessionid?

528


What is contextpath in jsp?

496


What is the difference in using request.getrequestdispatcher() and context.getrequestdispatcher()?

566


Can you override jspinit() method? If yes, in which cases?

505


List all tags that are provided in jstl?

493


How we can include the result of another page in jsp?

506