You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by dave Cheseldine <is...@bangor.ac.uk> on 2001/03/28 17:44:08 UTC

that "country-code" code on the Cocoon website

Hi

I'm sure a few people have studied the code on the User Guide area of the
Cocoon website:

<?xml version="1.0"?>
 <?cocoon-process type="xslt"?>
 <?xml-stylesheet href="page.xsl" type="text/xsl"?>
 <page>
   <country code="ca">Canada</country>
   <country code="de">Germany</country>
   <country code="fr">France</country>
   <country code="uk">United Kingdom</country>
   <country code="us">United States</country>
   <country code="es">Spain</country>
 </page>
 ---------------------------------------------------

<?xml version="1.0"?>
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                 version="1.0">

   <xsl:param name="countrycode"/>

   <xsl:template match="page">
     <html>
       <body>
         <xsl:choose>

           <xsl:when test="not($countrycode)">
             <p>Choose a country:</p>
             <form action="countries.xml" method="get">
               <select name="countrycode" size="1">
                 <xsl:apply-templates select="country" mode="form"/>
               </select>
               <input type="submit"/>
             </form>
           </xsl:when>

           <xsl:when test="country[@code=$countrycode]">
             <xsl:apply-templates select="country[@code=$countrycode]"
               mode="selected"/>
           </xsl:when>

           <xsl:otherwise>
             <p>Unknown country code
                <em><xsl:value-of select="$countrycode"/></em>.
             </p>
           </xsl:otherwise>

         </xsl:choose>
       </body>
     </html>
   </xsl:template>

   <xsl:template match="country" mode="form">
     <option><xsl:value-of select="@code"/></option>
   </xsl:template>

   <xsl:template match="country" mode="selected">
     <p><em><xsl:value-of select="@code"/></em> stands for
        <xsl:value-of select="text()"/></p>
   </xsl:template>

 </xsl:stylesheet>
--------------------------------------------------------------

NOW: the line

<xsl:when test="country[@code=$countrycode]">

How would it read if "code" was stored as an entity at the same level as the
country entity rather than as an attribute.  I've tried everything I can
think of
over the last week.

regards


Dave Cheseldine
Educational Technology Services
University of Wales Bangor

tel: 01248 383870

http://qas.bangor.ac.uk/daveches.html


---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: that "country-code" code on the Cocoon website

Posted by "Peter C. Verhage" <pe...@zeelandnet.nl>.
----- Original Message -----
From: "dave Cheseldine" <is...@bangor.ac.uk>
To: <co...@xml.apache.org>
Sent: Wednesday, March 28, 2001 5:44 PM
Subject: that "country-code" code on the Cocoon website

<< How would it read if "code" was stored as an entity at the same level as
the country entity rather than as an attribute.  I've tried everything I can
think of over the last week. >>

I don't know what you mean exactly by this, if you are saying at the same
level I'm thinking about a structure like this:
<page>
  <country>Canada<country>
  <code>...</code>
  etc.
</page>

But I think what you really mean is something like this:
<page>
  <country>
    <code>ca</code>
    Canada
  </country>
  etc.
</page>

I personally don't understand why you would like a structure like that, but
if you really want something like that, try this:
<xsl:when test="country/code/text()=$countrycode">

That will probably work...

Regards,

Peter

P.S.
This mailinglist is not ment for this sort of questions, try for example the
newsgroup news://comp.text.xml or read the Cocoon site for a link to a
special XML/XSL(T) mailinglist...


---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: esql Oracle problem

Posted by Donald Ball <ba...@webslingerZ.com>.
On Wed, 18 Apr 2001, dave Cheseldine wrote:

> Hi
>
> Cocoon 2.0a3
> Tomcat 4
> Oracle 8.1.6
>
> having problem establishing connection to Oracle db:  compilation falls down
> at
>         <esql:execute-query>
>
> with following error:
>
>   org.apache.cocoon.ProcessingException: Error compiling _esql_xsp: Line 0,
> column
>   0:
> /export/WWW/docs/javatemp2/cocoon2/tomcat_4/work/localhost/cocoon/_export/_W
> WW/_docs/_javatemp2/_cocoon2/_tomcat_4/_webapps/_cocoon/_docs/_samples/_xsp/
> _esql_xsp.java:284:
>   Exception java.lang.Exception must be caught, or it must be declared in
> the throws clause of this method.
>   esqlExecuteQuery_N1F(esqlSessions, esqlSession); ^

um, it rather looks like you're using an oooold version of the esql
logicsheet. refresh from cvs and see what you get.

- donald


---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


esql Oracle problem

Posted by dave Cheseldine <is...@bangor.ac.uk>.
Hi

Cocoon 2.0a3
Tomcat 4
Oracle 8.1.6

having problem establishing connection to Oracle db:  compilation falls down
at
        <esql:execute-query>

with following error:

  org.apache.cocoon.ProcessingException: Error compiling _esql_xsp: Line 0,
column
  0:
/export/WWW/docs/javatemp2/cocoon2/tomcat_4/work/localhost/cocoon/_export/_W
WW/_docs/_javatemp2/_cocoon2/_tomcat_4/_webapps/_cocoon/_docs/_samples/_xsp/
_esql_xsp.java:284:
  Exception java.lang.Exception must be caught, or it must be declared in
the throws clause of this method.
  esqlExecuteQuery_N1F(esqlSessions, esqlSession); ^

cocoon.xconf as follows:

<?xml version="1.0"?>
<cocoon version="2.0">

<!-- ===================== General Components
=========================== -->

  <component role="org.apache.cocoon.components.parser.Parser"
class="org.apache.cocoon.components.parser.XercesParser"/>
  <component role="org.apache.cocoon.components.store.Store"
class="org.apache.cocoon.components.store.MemoryStore"/>

  <component
role="org.apache.cocoon.components.language.programming.ProgrammingLanguageS
elector" class="org.apache.cocoon.CocoonComponentSelector">
    <component-instance name="java"
class="org.apache.cocoon.components.language.programming.java.JavaLanguage">
      <parameter name="compiler"
value="org.apache.cocoon.components.language.programming.java.Javac"/>
      <parameter name="code-formatter"
value="org.apache.cocoon.components.language.programming.java.JstyleFormatte
r"/>
      <parameter name="class-loader"
value="org.apache.cocoon.components.classloader.ClassLoaderManagerImpl"/>
    </component-instance>
  </component>

  <component
role="org.apache.cocoon.components.classloader.ClassLoaderManager"
class="org.apache.cocoon.components.classloader.ClassLoaderManagerImpl"/>

  <component
role="org.apache.cocoon.components.language.markup.MarkupLanguageSelector"
class="org.apache.cocoon.CocoonComponentSelector">
    <component-instance name="xsp"
class="org.apache.cocoon.components.language.markup.xsp.XSPMarkupLanguage">
      <parameter name="prefix" value="xsp"/>
      <parameter name="uri" value="http://apache.org/xsp"/>

      <target-language name="java">
        <parameter name="core-logicsheet"
value="resource://org/apache/cocoon/components/language/markup/xsp/java/xsp.
xsl"/>

        <builtin-logicsheet>
          <parameter name="prefix" value="xsp-request"/>
          <parameter name="uri" value="http://apache.org/xsp/request"/>
          <parameter name="href"
value="resource://org/apache/cocoon/components/language/markup/xsp/java/requ
est.xsl"/>
        </builtin-logicsheet>

        <builtin-logicsheet>
          <parameter name="prefix" value="xsp-response"/>
          <parameter name="uri" value="http://apache.org/xsp/response"/>
          <parameter name="href"
value="resource://org/apache/cocoon/components/language/markup/xsp/java/resp
onse.xsl"/>
        </builtin-logicsheet>

 <builtin-logicsheet>
   <parameter name="prefix" value="esql"/>
   <parameter name="uri" value="http://apache.org/cocoon/SQL/v2"/>
   <parameter name="href"
value="resource://org/apache/cocoon/components/language/markup/xsp/java/esql
.xsl"/>
 </builtin-logicsheet>

 <builtin-logicsheet>
   <parameter name="prefix" value="log"/>
   <parameter name="uri" value="http://apache.org/xsp/log"/>
   <parameter name="href"
value="resource://org/apache/cocoon/components/language/markup/xsp/java/log.
xsl"/>
 </builtin-logicsheet>
      </target-language>
    </component-instance>

    <component-instance name="sitemap"
class="org.apache.cocoon.components.language.markup.sitemap.SitemapMarkupLan
guage">
      <parameter name="prefix" value="map"/>
      <parameter name="uri" value="http://apache.org/cocoon/sitemap/1.0"/>

      <target-language name="java">
        <parameter name="core-logicsheet"
value="resource://org/apache/cocoon/components/language/markup/sitemap/java/
sitemap.xsl"/>
      </target-language>
    </component-instance>
  </component>

  <component
role="org.apache.cocoon.components.language.generator.ProgramGenerator"
class="org.apache.cocoon.components.language.generator.ProgramGeneratorImpl"
>
    <parameter name="auto-reload" value="true"/>
  </component>

  <!-- these components is used as a PoolController for the sitemap
component pools  -->
  <component role="org.apache.avalon.util.pool.PoolController"
class="org.apache.cocoon.util.ComponentPoolController"/>

<datasources>
       <component-instance name="foo"
class="org.apache.avalon.util.datasource.JdbcDataSource">
         <pool-controller min="1" max="5"/>
         <driver>oracle.jdbc.driver.OracleDriver</driver>


<dburl>jdbc:oracle:thin:@mimix.bangor.ac.uk:1521:my-test-database</dburl>
         <user>***</user>
         <password>***</password>
      </component-instance>
  </datasources>

  <sitemap file="sitemap.xmap"/>

</cocoon>


I have to admit to an incomplete understanding of cocoon.xconf, but are
there any obvious conflicts in the above?

Thanks in advance

dave Cheseldine



---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


ProgramGenerator not found: cocoon 2

Posted by dave Cheseldine <is...@bangor.ac.uk>.
Cocoon 2.0a3
Tomcat 4

In my cocoon.log file I get the following error when I try to load my
esql.xsp page:

ERROR   11053   [cocoon  ]
(Thread-39):
org.apache.cocoon.components.language.generator.ProgramGenerator could not
be found


I'm not entirely clear on what the ProgramGenerator is or why it couldn't be
found.  Something wrong in my
cocoon.xconf?

thanks for any advice;  btw, i do put all these error messages into search
engines before I email the group

dave Cheseldine


---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: cocoon 2: esql / Oracle

Posted by dave Cheseldine <is...@bangor.ac.uk>.
> >    <content>
> >
> >       <esql:execute-query inner-method="no">
> >
> >       <esql:use-connection>foo_connection</esql:use-connection>
> >
> >         <esql:query>select COMPANY from STOCKS</esql:query>
> >         <esql:results>
> >          <para><esql:get-string column="todays_high"/></para>
> >         </esql:results>
> >
> >       </esql:execute-query>
> >
> >    </content>

>    <content>
>
>       <esql:connection>
>         <esql:pool>foo_connection</esql:use-connection>
>         <esql:execute-query>
>
>           <esql:query>select COMPANY from STOCKS</esql:query>
>           <esql:results>
>            <esql:row-results>
>              <para><esql:get-string column="todays_high"/></para>
>            </esql:row-results>
>           </esql:results>
>
>       </esql:execute-query>
>       </esql:connection>
>
>    </content>
>
> There are three main differences:
> 1) addition of a root tag <esql:connection>, all <esql:execute-query>
>    inside that tag will share the same connection.
> 2) <esql:use-connection> has been changed to <esql:pool> and it is placed
>    as a child of <esql:connection> (makes sense doesn't it?).
> 3) The use of <esql:row-results> inside of <esql:results>.  There are
three
>    types of results you can expect from a query: <esql:row-results>,
>    <esql:no-results>, <esql:error-results>.  You can vary your output
based
>    on the type of result.
>
> > and the have added the following to cocoon.xconf
> >
> >   <datasources>
> >
> >      <component-instance name="foo_connection"
> > class="org.apache.avalon.util.datasource.JdbcDataSource">
> >        <pool-controller min="1" max="5"/>
> >        <dburl>jdbc:oracle:thin:mimix.bangor.ac.uk:1521:bangori</dburl>
> >        <user>scott</user>
> >        <password>catman</password>
> >     </component-instance>
> >
> >   </datasources>
>
> I don't know if you meant to place your user and password in the file, BUT
> the syntax is correct.
>
> > So far I haven't seen any sign that a connection to the database has
been
> > made.
> > Are there any other files that need to be changed?
>
> No.  Just fix your esql file.  Also, there is a log file in
> $CONTEXT/WEB-INF/logs/cocoon.log that will give you tons of debugging
info.
> If you can't seem to get something working, the messages in there will
help
> understand how cocoon works, and what errors it has received.
>
>
> PS: Make sure that the initial parameter "force-load" has the Oracle
driver
> class in there. The entries are white space and comma delimited.
>
> ---------------------------------------------------------------------
> 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: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
>


---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Undefined variable: xspAttr: "row-results"

Posted by Berin Loritsch <bl...@apache.org>.
Anders Högqvist wrote:
> 
> Hi!
> 
> First of all you must put a ; after your SELECT statement.

No.  Oracle chokes on that.  And that doesn't explaing the
problems he is having.

With the variable xspAttr, I am asumming you are using Cocoon 2?
This usually happens when you have methods that issue SAX events,
and the author of the taglib forgot to add the xspAttr variable.

> 
> /anders
> 
> ----- Original Message -----
> From: "dave Cheseldine" <is...@bangor.ac.uk>
> To: <co...@xml.apache.org>
> Sent: Wednesday, April 11, 2001 1:15 PM
> Subject: Undefined variable: xspAttr: "row-results"
> 
> > Sorry, last email did not specify the error message
> > in full.  Should have read
> >
> > Undefined variable: xspAttr: "row-results"
> >
> > this error is occurring during compilation of esql.xsp which is as
> follows:
> >
> > <?xml version="1.0" encoding="ISO-8859-1"?>
> >
> > <xsp:page
> >           language="java"
> >           xmlns:xsp="http://apache.org/xsp"
> >    xmlns:esql="http://apache.org/cocoon/SQL/v2"
> > >
> >
> >   <page>
> >
> >    <title>A Database Driven XSP Page 2</title>
> >
> >    <content>
> >
> >       <esql:connection>
> >         <esql:pool>foo_connection</esql:pool>
> >         <esql:execute-query>
> >
> >
> >          <esql:query>select COMPANY from STOCKS
> >          </esql:query>
> >           <esql:results>
> >             <esql:row-results>
> >               <para>
> >                 <esql:get-string column="todays_high"/>
> >               </para>
> >             </esql:row-results>
> >           </esql:results>
> >       </esql:execute-query>
> >
> >     </esql:connection>
> >
> >    </content>
> >   </page>
> > </xsp:page>
> >
> >
> > ---------------------------------------------------------------------
> > 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: <co...@xml.apache.org>
> > For additional commands, e-mail: <co...@xml.apache.org>
> >
> >
> 
> ---------------------------------------------------------------------
> 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: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>

---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Undefined variable: xspAttr: "row-results"

Posted by Anders Högqvist <ho...@hotmail.com>.
Hi!

First of all you must put a ; after your SELECT statement.


/anders



----- Original Message -----
From: "dave Cheseldine" <is...@bangor.ac.uk>
To: <co...@xml.apache.org>
Sent: Wednesday, April 11, 2001 1:15 PM
Subject: Undefined variable: xspAttr: "row-results"


> Sorry, last email did not specify the error message
> in full.  Should have read
>
> Undefined variable: xspAttr: "row-results"
>
> this error is occurring during compilation of esql.xsp which is as
follows:
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
>
> <xsp:page
>           language="java"
>           xmlns:xsp="http://apache.org/xsp"
>    xmlns:esql="http://apache.org/cocoon/SQL/v2"
> >
>
>   <page>
>
>    <title>A Database Driven XSP Page 2</title>
>
>    <content>
>
>       <esql:connection>
>         <esql:pool>foo_connection</esql:pool>
>         <esql:execute-query>
>
>
>          <esql:query>select COMPANY from STOCKS
>          </esql:query>
>           <esql:results>
>             <esql:row-results>
>               <para>
>                 <esql:get-string column="todays_high"/>
>               </para>
>             </esql:row-results>
>           </esql:results>
>       </esql:execute-query>
>
>     </esql:connection>
>
>    </content>
>   </page>
> </xsp:page>
>
>
> ---------------------------------------------------------------------
> 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: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
>
>

---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Undefined variable: xspAttr: "row-results"

Posted by dave Cheseldine <is...@bangor.ac.uk>.
Sorry, last email did not specify the error message
in full.  Should have read

Undefined variable: xspAttr: "row-results"

this error is occurring during compilation of esql.xsp which is as follows:

<?xml version="1.0" encoding="ISO-8859-1"?>

<xsp:page
          language="java"
          xmlns:xsp="http://apache.org/xsp"
   xmlns:esql="http://apache.org/cocoon/SQL/v2"
>

  <page>

   <title>A Database Driven XSP Page 2</title>

   <content>
   
      <esql:connection>
        <esql:pool>foo_connection</esql:pool>
        <esql:execute-query>
        
        
         <esql:query>select COMPANY from STOCKS
         </esql:query>
          <esql:results>
            <esql:row-results>
              <para>
                <esql:get-string column="todays_high"/>
              </para>
            </esql:row-results>
          </esql:results>
      </esql:execute-query>
   
    </esql:connection>  

   </content>
  </page>
</xsp:page>


---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


esql problem "Undefined variable: xspAttr"

Posted by dave Cheseldine <is...@bangor.ac.uk>.
Hi

 using
Cocoon 2.0a3
Tomcat 4

I'm trying to connect to an Oracle database using esql

my cocoon.xconf is as follows:

  <component
role="org.apache.cocoon.components.datasource.DataSourceComponentSelector"
    class="org.apache.cocoon.CocoonComponentSelector">
    <component-instance name="foo_connection"
class="org.apache.cocoon.components.datasource.JdbcDataSource">
      <pool-controller min="5" max="10"/>
      <driver>oracle.Driver</driver>
      <dburl>jdbc:oracle:@mimix.bangor.ac.uk:1521:bangori</dburl>
      <user>****</user>
      <password>****</password>
    </component-instance>
  </component>

where "bangori" is the database I want to connect to on port 1521.  This
pulls up the error
"Undefined variable: xspAttr" when I try to load the xsp page containing the
query.

I have come across a different method of specifying a component-instance for
a db connection in cocoon.xconf:

  <datasources>
    <component-instance name="foo_connection"
class="org.apache.avalon.util.datasource.JdbcDataSource">
        <pool-controller min="5" max="10"/>
        <dburl>jdbc:oracle:thin:@mimix.bangor.ac.uk:1521:bangori</dburl>
        <user>****</user>
        <password>****</password>
     </component-instance>
   </datasources>

I'm not sure which syntax to follow.

thanks for any advice

dave Cheseldine




---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: cocoon 2: esql / Oracle

Posted by Berin Loritsch <bl...@apache.org>.
dave Cheseldine wrote:
> 
> Hi
> 
> To get an xsp page to query an Oracle database, I have changed
> the text in esql.xsp to

My first question is what version of Cocoon 2 are you using?  If
it is a recent CVS (Cocoon 2.0a4) then your syntax is wrong for
your esql code.  The syntax has been changed, and you are following
the old format.  Cocoon 2 and Cocoon 1's version of esql are
pretty much in synch.

>    <content>
> 
>       <esql:execute-query inner-method="no">
> 
>       <esql:use-connection>foo_connection</esql:use-connection>
> 
>         <esql:query>select COMPANY from STOCKS</esql:query>
>         <esql:results>
>          <para><esql:get-string column="todays_high"/></para>
>         </esql:results>
> 
>       </esql:execute-query>
> 
>    </content>

Try this instead (BTW, I am assuming you have xsp:page set up correctly):

   <content>

      <esql:connection>
        <esql:pool>foo_connection</esql:use-connection>
        <esql:execute-query>

          <esql:query>select COMPANY from STOCKS</esql:query>
          <esql:results>
           <esql:row-results>
             <para><esql:get-string column="todays_high"/></para>
           </esql:row-results>
          </esql:results>

      </esql:execute-query>
      </esql:connection>

   </content>

There are three main differences:
1) addition of a root tag <esql:connection>, all <esql:execute-query>
   inside that tag will share the same connection.
2) <esql:use-connection> has been changed to <esql:pool> and it is placed
   as a child of <esql:connection> (makes sense doesn't it?).
3) The use of <esql:row-results> inside of <esql:results>.  There are three
   types of results you can expect from a query: <esql:row-results>,
   <esql:no-results>, <esql:error-results>.  You can vary your output based
   on the type of result.

> and the have added the following to cocoon.xconf
> 
>   <datasources>
> 
>      <component-instance name="foo_connection"
> class="org.apache.avalon.util.datasource.JdbcDataSource">
>        <pool-controller min="1" max="5"/>
>        <dburl>jdbc:oracle:thin:mimix.bangor.ac.uk:1521:bangori</dburl>
>        <user>scott</user>
>        <password>catman</password>
>     </component-instance>
> 
>   </datasources>

I don't know if you meant to place your user and password in the file, BUT
the syntax is correct.

> So far I haven't seen any sign that a connection to the database has been
> made.
> Are there any other files that need to be changed?

No.  Just fix your esql file.  Also, there is a log file in
$CONTEXT/WEB-INF/logs/cocoon.log that will give you tons of debugging info.
If you can't seem to get something working, the messages in there will help
understand how cocoon works, and what errors it has received.


PS: Make sure that the initial parameter "force-load" has the Oracle driver
class in there. The entries are white space and comma delimited.

---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Beans and XSP

Posted by tony <to...@employer.com.br>.
Hi there,

I'm trying to use a bean in my XSP page. (As a matter of fact, I'm tying to
get how XSP hell works...)

In the following code in my test.xml

<xsp:structure>
  <xsp:include>mypackage.myobject</xsp:include>
</xsp:structure>


But Gets me a:

--------------------
java.lang.Exception: XSP Java Compiler: Compilation failed for _test.java
83: Undefined variable, class, or package name: java

    mypackage.myobject
--------------------

I've got a JSP page in the same dir using the same bean and it works fine:
<jsp:useBean id='DBAccess' class='mypackage.myobject' scope="session" />

What did I do wrong ?

Thanks in advance,

Tony.


---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: cocoon 2: session.xsl

Posted by David Holsclaw <ho...@mac.com>.
Berin,

Thanks for the reply.

re: <session:set-attribute name="foo">value</session:set-attribute>

This is what I was doing but the java code generated by session.xsl had 
syntax errors. I'll have to look into them again before I can be more 
specific.

In an effort to get around that problem, I started using 
XSPRequestHelper.setSessionAttribute directly. Unfortunately, 
setSessionAttribute doesn't appear to be implemented yet.

I also, thought I could just get the HttpSession from the request object 
but I can't seem to include/import anything from javax.servlet?

As a reminder I am using a cvs pull of c2 (day or two old) and Tomcat4 
(beta3 and also tried a nightly build from last week) on Mac OS X.

Thanks again.
---
Dave


On Thursday, April 5, 2001, at 07:51 AM, Berin Loritsch wrote:

> David Holsclaw wrote:
>>
>> Does anyone have a simple example of using the session logicsheet with
>> C2?
>>
>> I have been able to pull data out of the session but can't seem to get
>> the syntax right in my call to <session:set-attribute>.
>
> I usually onle get session attributes with it, I have not tried setting
> any--mainly because I use actions to do that part.  The session page
> is not _as_ well tested.  Try the following:
>
> <session:set-attribute name="foo">value</session:set-attribute>
>
> Check the logs in $CONTEXT/WEB-INF/logs/cocoon.log where $CONTEXT is
> where you installed the Cocoon context.
>
> ---------------------------------------------------------------------
> 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: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
>

---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: cocoon 2: session.xsl

Posted by Berin Loritsch <bl...@apache.org>.
David Holsclaw wrote:
> 
> Does anyone have a simple example of using the session logicsheet with
> C2?
> 
> I have been able to pull data out of the session but can't seem to get
> the syntax right in my call to <session:set-attribute>.

I usually onle get session attributes with it, I have not tried setting
any--mainly because I use actions to do that part.  The session page
is not _as_ well tested.  Try the following:

<session:set-attribute name="foo">value</session:set-attribute>

Check the logs in $CONTEXT/WEB-INF/logs/cocoon.log where $CONTEXT is
where you installed the Cocoon context.

---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


cocoon 2: session.xsl

Posted by David Holsclaw <ho...@mac.com>.
Does anyone have a simple example of using the session logicsheet with 
C2?

I have been able to pull data out of the session but can't seem to get 
the syntax right in my call to <session:set-attribute>.

Thanks!
---
Dave

---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


cocoon 2: esql / Oracle

Posted by dave Cheseldine <is...@bangor.ac.uk>.
Hi

To get an xsp page to query an Oracle database, I have changed
the text in esql.xsp to

   <content>

      <esql:execute-query inner-method="no">

      <esql:use-connection>foo_connection</esql:use-connection>

        <esql:query>select COMPANY from STOCKS</esql:query>
        <esql:results>
         <para><esql:get-string column="todays_high"/></para>
        </esql:results>

      </esql:execute-query>

   </content>

and the have added the following to cocoon.xconf

  <datasources>

     <component-instance name="foo_connection"
class="org.apache.avalon.util.datasource.JdbcDataSource">
       <pool-controller min="1" max="5"/>
       <dburl>jdbc:oracle:thin:mimix.bangor.ac.uk:1521:bangori</dburl>
       <user>scott</user>
       <password>catman</password>
    </component-instance>

  </datasources>

So far I haven't seen any sign that a connection to the database has been
made.
Are there any other files that need to be changed?

thanks in advance

dave Cheseldine


---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>