cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nadine Carlton" <>
Subject Parameter passing with cocoon
Date Thu, 17 Aug 2000 22:27:33 GMT

  I'm running Cocoon 1.7.3 and have it successfully accessing an
Oracle database thanks to help from this group.

  I have a different question though.  I need to pass parameters
to the Cocoon servers.  The parameters may come from a browser
client in a client/server environment, but they may also be passed
through an application server in a three tier environment.  From the
Cocoon XSP documentation and a sample in Brett McLaughlin's
Java and XML book, I'm trying to debug a two tier sample.  It 
currently won't parse and I've included the XSP file and the parser
error below.  Does anyone see what is wrong with the code?  Is there
an option to get more information about where the parsing is failing?

  Also, how should I design the 3-tier, client/application server/backend DB server
code?  For example, should parameters between the app server (written in Java)
and DB server (written with Cocoon) be sent in an XML document or
similar to the two tier parameter solution?  Does anyone have pointers
to sample code for this?

Nadine Carlton

<?xml version="1.0" ?>
<?cocoon-process type="xsp"?>
<?cocoon-process type="sql"?>
<?cocoon-process type="xslt"?>
<?xml-stylesheet href="sorttest.xsl" type="text/xsl"?>
     String[] dbuserparmValues = request.getParameterValues("user");
     String[] dbpasswordparmValues = request.getParameterValues("password");
     String[] customerparmValues = request.getParameterValues("customer");
     String[] propertiesparmValues = request.getParameterValues("properties");

     if (dbuserparmValues != null) {
         String dbuserparm = dbuserparmValues[0];
     } else{
         String dbuserparm = "scott";
     if (dbpasswordparmValues != null) {
         String dbpasswordparm = dbpasswordparmValues[0];
     } else{
         String dbpasswordparm = "tiger";
     if (customerparmValues != null) {
         String querystring = "select * from emp where ENAME like 'customerparmValues[0]%';
     } else{
         String querystring = "select * from emp";

  <page title="SQL Search Results">
The parser error in the browser:
<html> <head>  <meta name="GENERATOR" content="Cocoon 1.7.3"> </head>
<body> <p><br></p> <center>  <table border="0" width="80%"
bgcolor="#000000" cellspacing="0" cellpadding="0">  <tr>   <td width="100%"><table
border="0" width="100%" cellpadding="4">    <tr>     <td width="100%" bgcolor="#c0c0c0"><p
align="right"><font color="red"><big><big>Cocoon 1.7.3</big></big></font></td>
   </tr>    <tr>      <td width="100%" bgcolor="#f0f0f0">       <p align="center"><br></p>
<h3 align="center">Error found handling the request.</h3>
<blockquote><pre>org.xml.sax.SAXParseException: The markup in the document following
the root element must be well-formed.
 at org.apache.cocoon.parser.AbstractParser.fatalError(
 at org.apache.xerces.framework.XMLParser.reportError(
 at org.apache.xerces.framework.XMLDocumentScanner$TrailingMiscDispatcher.dispatch(,
Compiled Code)
 at org.apache.xerces.framework.XMLDocumentScanner.parseSome(, Compiled
 at org.apache.xerces.framework.XMLParser.parse(, Compiled Code)
 at org.apache.cocoon.parser.XercesParser.parse(
 at org.apache.cocoon.parser.AbstractParser.parse(
 at org.apache.cocoon.producer.ProducerFromFile.getDocument(
 at org.apache.cocoon.Engine.handle(, Compiled Code)
 at org.apache.cocoon.Cocoon.service(
 at javax.servlet.http.HttpServlet.service(
 at org.apache.jserv.JServConnection.processRequest(
      </td>     </tr>     <tr>      <td width="100%" bgcolor="#FFFFFF">
      <strong>Warning</strong>: this page has been dynamically generated.    
 </td>     </tr>    </table>   </td>  </tr> </table> </center>
<p align="center">   <font size="-1">   Copyright (c) 1999-2000 <a href="">The
Apache XML Project</a>.<br>   All rights reserved.   </font> </p>
</body> </html>

View raw message