wood burning stoves 2.0*
The moose likes JSP and the fly likes what are the total ways to include? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "what are the total ways to include?" Watch "what are the total ways to include?" New topic
Author

what are the total ways to include?

ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
What are the total ways to include one jsp file into another jsp?

Thanks.
Natasza Biecek
Greenhorn

Joined: Oct 26, 2006
Posts: 28
hmm, for example:

<%@ include file="additional_file.jsp" %>

or

<jsp:include page="any_page.jsp" />

:roll:

Natasza
pradheesh manohar
Greenhorn

Joined: Oct 09, 2006
Posts: 10
i would like to add few points to Natasza Biecek's reply

<%@ include file="additional_file.jsp" %> is called as directive include ,
or static include .this is used to include static content such as headers to your pages that are not expected to change .since it may be loaded from cache memory on subsequent pages.

<jsp:include page="any_page.jsp" /> is called as dynamic include .this is used to include dynamic content which changes frequently and must always be up to date
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by rathi ji:
What are the total ways to include one jsp file into another jsp?

Thanks.


What is your answer?
Normally, I would assume that this is a homework question and close the thread but you've been here too long and made too many posts to still be in a JSP class.

What are you trying to acomplish with such a short question that requires a long answer?


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
Originally posted by Ben Souther:


What is your answer?
Normally, I would assume that this is a homework question and close the thread but you've been here too long and made too many posts to still be in a JSP class.

What are you trying to acomplish with such a short question that requires a long answer?


Sorry Ben. Actually I just don't remember all the includes (directive and action then static and dynamic etc) so instead of looking at book I asked here. Sorry again.

Thanks Natasza and pradheesh for answers. It clears me.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

see
http://faq.javaranch.com/view?IncludesActionDirective

Also, the JSTL spec provides some additional ways to do this.
A link to the spec can be found in the JSP FAQ as well.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: what are the total ways to include?
 
Similar Threads
how to include a file in ajax implemented jsp page?
url rewriting
Session Maintaining
forwarding within the application
call one jsp from another jsp