----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files.  Don't make us guess your problem!!!
----------------------------------------------------------------

<jsp:include page="/whatever.jsp" flush="true" />

The page attribute is allowed to be calculated, so you can use

<jsp:include page="<%=mybean.getIncludePage()%>" flush="true" />

if you want to. Note that the flush="true" part is required even though
true is the only legal value for it (for some reason jsp doesn't default
it).

I am using this to great effect in the web application I am building
atm.

[As a side note, and not to get into the off-topic flamewar going on in
another subthread, I haven't found JSP to be nearly as ugly as some
people make it out to be. It does take somewhat of a perl-like approach
in that it throws everything and the kitchen sink into the language,
leaving it up to the author to choose a subset that allows for a clean
design. But as long as you do make a good choice of subset to use, it's
pretty clean and can provide pretty good separation of content from
presentation. JSP1.1's taglibs should make this even more true - I'm
stuck on 1.0 atm.

Also, the dig about "recompilation" is misguided. Recompilation happens
only when the page has changed, and after that the page is cached and
executed directly from memory. It performs a *lot* better than any
interpreted solution could, except for the first page access after a
change. And how often do you change your pages compared to how often
they are viewed? Also, JSP doesn't *require* implementations to use
compilation - it's just that that method is used by almost all
implementations because of the performance gain.]

Just my .4 nickels,
Stuart.

Gary Lawrence Murphy wrote:
> 
> ----------------------------------------------------------------
> BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
> WHEN YOU POST, include all relevant version numbers, log files,
> and configuration files.  Don't make us guess your problem!!!
> ----------------------------------------------------------------
> 
> I don't even know if this is possible, but my current project
> will be much simplified if I can avoid re-inventing the wheel:
> 
> I need my JSP page to process another JSP page recursively.  The
> process would go like this:
> 
>    based on the page state, the main page would decide to transfer
>    temporary output control to another distinct page, and if that page
>    has changed since the last attempt, the JSP-syntax sub-page would
>    be recompiled into a Java class, reloaded, and executed, otherwise
>    the resident class would just be executed.  When that class is done
>    its work, flow returns to the parent JSP page.
> 
> I can't use <%@ includes %> because there may be hundreds of these of
> which only maybe 20 will be used regularly.  Basically I want to
> create a page server which can fetch content sources from a URL (like
> RDF files) and insert the results into a section of the output page,
> but (unlike RDF) the content may be JSP syntax which will be compiled
> into a Java class according to the same rules as the parent JSP page.
> Also, the flow would not be like chaining servlets, but just a
> function call.  If at all possible, I'd like to re-use the JSP parser
> and compile mechanism and keep it all very light weight; it is
> essential this process be ready for 50 simultaneous clients each with
> 20-30 class invocations per page.
> 
> Does anything like this already exist?
> 
> --
> Gary Lawrence Murphy <[EMAIL PROTECTED]>  TeleDynamics Communications Inc
> Business Innovations Through Open Source Systems: http://www.teledyn.com
> Linux/GNU Education Group: http://www.egroups.com/group/linux-education/
> "Computers are useless.  They can only give you answers."(Pablo Picasso)
> 
> --
> --------------------------------------------------------------
> Please read the FAQ! <http://java.apache.org/faq/>
> To subscribe:        [EMAIL PROTECTED]
> To unsubscribe:      [EMAIL PROTECTED]
> Archives and Other:  <http://java.apache.org/main/mail.html>
> Problems?:           [EMAIL PROTECTED]

-- 
Stuart Ballard
Programmer
NetReach, Inc.: Single-Source Provider of Internet Solutions
One eCommerce Plaza
124 South Maple Street
Ambler, PA 19002
215.283-2300, x126
www.netreach.net
[EMAIL PROTECTED]


--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/main/mail.html>
Problems?:           [EMAIL PROTECTED]

Reply via email to