How about 'saving' the query to the request scope as below:
qry_getdata.jsp:
-----------------
<% request.setAttribute("ClipsQuery", get_Clips); %>
You should then be able to reference it in test.jsp as below:
test.jsp:
-----------
<% QueryTable myClipsData = (QueryTable) request.getAttribute("ClipsQuery");
%>
<jrun:foreach group="<%=myClipsData%>" >
<%= myClipsData.get("clipNumber") %>
</jrun:foreach>
At least, that's my theory....
Nathan Wheat
Technical Sales Consultant
Firmware Design
Phone: 0401 148 989
Email: [EMAIL PROTECTED]
http://www.firmware.com.au
Full-featured Content Management Systems need not cost a million!
Check out our new range of Ektron CMS
Download a 30-day FREE demo today!
<http://news.firmware.com.au/ektron/ft>
-----Original Message-----
From: Jay [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 4 September 2001 1:10 PM
To: JRun-Talk
Subject: Re: Newbie question - Query
I tried but it still does not work. Is it possible to have a query in an
included page and that query referenced and output in the calling page,
thereby encapsulating the query to be called again and again in various
pages? This is what I am trying to do with no success!
----- Original Message -----
From: "Laurence Middleton" <[EMAIL PROTECTED]>
To: "JRun-Talk" <[EMAIL PROTECTED]>
Sent: Monday, September 03, 2001 9:58 AM
Subject: RE: Newbie question - Query
> Jay:
>
> I think you want the other form of include:
>
> <%@ include file="myIncludedFile.jsp" %>
>
> The <jsp:include> tag doesn't pass your data structures, etc. (that's what
> the flush="true" does -- you're only getting the http response stuff).
>
> To test, copy the content of your included file in place of your
> <jsp:include> -- if it works, you'll know that only the include was the
> problem.
>
> hth,
> Laurence
>
> Laurence Middleton
> code wrangler
> ecentricarts inc.
> 416 644-5000 ext.225
>
>
> > -----Original Message-----
> > From: Jay [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, August 31, 2001 4:09 PM
> > To: JRun-Talk
> > Subject: Newbie question - Query
> >
> >
> > I am trying to include a jsp template that contains a query and output
the
> > result set in another page. Somehow I cannot find good documentation on
> > doing this. I keep getting the following error:
> >
> > ********** Undefined variable or class name: get_Clips
> > out.print(get_Clips.get("clipNumber")); ***********
> >
> >
> >
> > Can someone help!!!
> >
> >
> >
> >
> > Here is of the code
> >
> > test.jsp
> > ---------
> >
> > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> >
> > <html>
> > <head>
> > <title>test</title>
> > </head>
> >
> > <body>
> >
> > <%@ page import = "allaire.taglib.*" %>
> > <%@ taglib uri="jruntags" prefix="jrun" %>
> >
> > <jsp:include page="qry_getdata.jsp" flush="true"/>
> >
> > </jsp:include>
> >
> > <jrun:foreach group="get_Clips" >
> > <%= get_Clips.get("clipNumber") %>
> > </jrun:foreach>
> >
> > </body>
> > </html>
> >
> >
> >
> >
> >
> > qry_getdata.jsp
> > ---------------------
> >
> > <jrun:sql datasrc="test" id="get_Clips">
> > select * from ClipData
> > </jrun:sql>
> >
> > <jrun:param id="get_Clips" type="QueryTable" />
> >
> >
> >
> >
> >
> >
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists