Christopher Painter-Wakefield wrote:
>
> Alexandru,
>
> look at your generated code, and I think you'll see why this doesn't work.
> ESQL creates a number of local variables inside the populateDocument()
> method, which it needs for its tags. These local variables obviously
> aren't available to other methods in the class.
I have successfully created methods in my XSP logicsheets that used ESQL.
The major caveat is that you must use it from the <esql:connection/> element.
You will find that you cannot nest <esql:execute-query/> elements inside an
element without first surrounding it with the connection element.
I have also successfully did the equivalent with XSL in my logicsheet by
only applying the ESQL elements I wanted. This approach is _only_ available
when you convert the ESQL portions of your XSP page into a LogicSheet that
can be manipulated by XSL. The power of this approach is much better than
traditional Java methods.
>
> -Christopher
>
> Please respond to [EMAIL PROTECTED]
>
> To: <[EMAIL PROTECTED]>
> cc:
>
> Subject: XSP code reuse problems
>
> Hello,
> Trying to implement the code reuse with the XSP method reusePart,
> I've come into problems when the method should use the esql taglib.
> When I write a simple method, it works flawlessly and it's
> reusable.
> But when I try to add a esql quey, I ran into problems.
> The pasted code below does not execute the esql part, and I think
> this happend because the code fragment is locate above the <page> tag.
>
> <xsp:logic>
> private void TwoLevel(String param) throws SAXException {
> AttributesImpl xspAttr = new AttributesImpl();
> int k = 1;
> int idinf = 0;
> </xsp:logic>
>
> <esql:execute-query>
> <esql:query>
> select * from v_inf where (idinf_inf is
> null and idtype_inf=1) order by name_itm
> </esql:query>
> </esql:execute-query>
>
> <xsp:logic>
> <recordset1>
> <xsp:expr>param</xsp:expr>
> </recordset1>
> }
> </xsp:logic>
>
> Alexandru
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
> To unsubscribe, e-mail: <[EMAIL PROTECTED]>
> For additional commands, e-mail: <[EMAIL PROTECTED]>
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>