This week's book / license giveaways are in the JDBC and Relational Databases and Java in General forums.
We're giving away four copies each of PostGIS in Action and Java Advanced Topics Training and have the authors on-line!
See this thread and this one for details.
The moose likes JSP and the fly likes include directive and include action Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
Bookmark "include directive and include action" Watch "include directive and include action" New topic
Author

include directive and include action

Raghu Shree
Ranch Hand

Joined: Mar 18, 2005
Posts: 143
what are the difference between include directive and include action?


Raghu J<br />SCJP 1.4<br /> <br />The Wind and waters are always<br />on the side of the ablest navigators.<br /><a href="http://groups.yahoo.com/group/scjp_share" target="_blank" rel="nofollow">SCJP Group</a><br /><a href="http://groups.yahoo.com/group/JavaBeat_SCWCD" target="_blank" rel="nofollow">SCWCD Group</a>
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 62488
    
  68

One is a run-time include and the other is a translation-time include. This gets asked a lot so look through the forum history if you'd like more details.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Raghu Shree
Ranch Hand

Joined: Mar 18, 2005
Posts: 143
Hello Bear Bibeault,
Thanks for the reply. Before my posting I searched with this question in this forum. But I didn't get the exact difference. So again I have posted this question. From your reply I know include directive is included at translation time and include action is included the source at request time.

I have another one doubt. Is it possible to retrive the parameter which is used in include page. If yes please give me some more hints.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Try searching this forum with: include action directive difference.
I just did and found thirteen threads that discuss this (some are better than others).

Your second question was straightforward enough that it would have been quicker to write a test app and run it for the answer than to wait for someone to respond here:

Page A:


Page B (the included page):

Name page A anything you want but page B must be named pageb.jsp.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

I've just added an entry to the FAQ for this issue.
It's not comprehensive yet but it should be enough to answer most people's questions on the issue.

http://faq.javaranch.com/view?IncludesActionDirective
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 62488
    
  68

Excellent entry, Ben.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by Bear Bibeault:
Excellent entry, Ben.


Thank you.

It looks like someone added the mention of the jspf convention.
Good catch.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 62488
    
  68

Yeah, that was me. I also fixed a few typos. Hope you don't mind.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Not at all.
I was planning on going back and cleaning it up some more.
Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: include directive and include action