What is the use of include statement in jsp?

What ate the tag available in jsp?

could you explain the page attributes tag
Manikandan ThiagarajanSenior consultantAsked:
Who is Participating?
gksinghietConnect With a Mentor Commented:
>>What is the use of include statement in jsp?
There are two types of includes in JSP, one is static include using include directive and other is dynamic include using <jsp:include> tag. Static include just copies the content of the included page into the including page at compile (translation) time.
>>What ate the tag available in jsp?
>>could you explain the page attributes tag
Are you asking about page directive  <@ page>?
arun_kuttzConnect With a Mentor Commented:
check out the link... its a syntax refereance for JSP (2.0)...
its got a pretty decent description of the include tag.. as well as a list of all <jsp:...> tags


Manikandan ThiagarajanSenior consultantAuthor Commented:
at what purpose we go for compile time attribute and runtime attribute
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

If I am gussing it right you wnat to know when to use static include and when dynamic include.
If you want that on changing your included JSP the change gets reflected in the including JSP you use dynamic include otherwise use static include. Also if you want to use the parameters declared in the including page in the included page you prefer static include.
Manikandan ThiagarajanSenior consultantAuthor Commented:
could you give me a simple example for include with syntax
Static Include:
<%@ include file="includeMe.jsp" %>
Dynamic Include:
<jsp:include page="includeMe.jsp" />
Manikandan ThiagarajanSenior consultantAuthor Commented:
difference between include and forward
Forward is for forwarding the request to another page where as include is for including a page or its output stream into another page.
I think you should go through a JSP tutorial like the one provided by Sun. This will answer most of your question.
Following Link might help:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.