You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Andres Olave <an...@flynk.com> on 2001/01/22 05:59:25 UTC

problem with requestDispatcher

Hi all,

Below is the code that im trying to get working using cocoon 1.8  served on
apache-tomcat 3.1 on win2K.

The resultant document consists of the complete page that had been forwarded
to. Below the </wml> tag however is   the original page up to the point that
the return occured in XSP (basically only the <page name="ftsol"> element
which has been processed by XSLT resulting in only the headers and a lone
wml element).

Effectively when you view the document, it looks like this:


	<?xml version="1.0" encoding="ISO-8859-1"?>
	<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">
	<wml>
	.
	.
	.
	</wml>
	<!-- This page was served in 5889 milliseconds by Cocoon 1.8 -->
	<?xml version="1.0" encoding="ISO-8859-1"?>
	<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">
	<wml>
	</wml>
	<!-- This page was served in 12303 milliseconds by Cocoon 1.8 -->

Now considering that the page forwarded should be the only thing in the
resultant document.    I'm wondering whether im doing something wrong,
theres something dodgy with my version of cocoon or what? Interestingly if i
substitute sendRedirect rather than a usng RequestDispatcher.forward() it
works fine.

I'd prefer not to use sendRedirect() because this requires a decent speed
network and browser support, which isnt the best way to go in the wap
market.

thanks
Andres

XML Code:	ft.xml

<?xml version="1.0"?>
<?cocoon-process type="xsp"?>
<?cocoon-process type="xslt"?>
<?xml-stylesheet href="XSL\ftstandard.wml.xsl" type="text/xsl" media="wap"?>
<?xml-logicsheet href="XSP\ft.xsp.xsl" type="text/xsl"?>
<xsp:page language="java"
					xmlns:xsp="http://www.apache.org/1999/XSP/Core"
					xmlns:ft="http://www.flynk.com/ft_beta/ft">

	<page name="ftsol">
		<ft:init/>
	 	<Bag type="details">
		.
		.[many many tags]
		.
		</Bag>
 	</page>
</xsp:page>

XML Code:	ft.xsp

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
								xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
								xmlns:xsp="http://www.apache.org/1999/XSP/Core"
								xmlns:ftSol="http://www.flynk.com/ft_beta/ftSol">

<xsl:template match="xsp:page">
   <xsp:page>
       <xsl:copy>
           <xsl:apply-templates select="@*"/>
       </xsl:copy>
       <xsp:logic>

		/* returns false if session object is null or contains no attributes */
        public boolean initSol(HttpServletRequest request,
HttpServletResponse response, HttpSession session, ServletContext context) {
		.
		.
		.
		}
       </xsp:logic>
       <xsl:apply-templates/>
	</xsp:page>
</xsl:template>


<!-- Detailed Solution Infomation methods -->
<xsl:template match="ftSol:init">
	<xsp:logic>
	if (!initSol(request,response,session,servletContext)) {

request.getRequestDispatcher(response.encodeRedirectURL("ftmain.xml")).forwa
rd(request,response);
  		return;
  	}
  </xsp:logic>
</xsl:template>

</xsl:stylesheet>


Re: Duplicate variable declaration: PoolBrokerService

Posted by Donald Ball <ba...@webslingerZ.com>.
On Mon, 22 Jan 2001, Andreas Neuenschwander wrote:

> Hi
>
> After the upgrade from Cocoon 1.8 to Cocoon 1.8.1, I get the following
> errors
> on pages which uses ESQL:

the esql schema changed incompatibly from 1.8 to 1.8.1, that is probably
the source of your trouble. you also may need to nuke your repository
after stopping cocoon and then restart.

- donald


Duplicate variable declaration: PoolBrokerService

Posted by Andreas Neuenschwander <an...@andi.ch>.
Hi

After the upgrade from Cocoon 1.8 to Cocoon 1.8.1, I get the following
errors
on pages which uses ESQL:

java.lang.Exception: XSP Java Compiler: Compilation failed for _process.java
121: Duplicate variable declaration: PoolBrokerService _esql_pool was
PoolBrokerService _esql_pool
          static PoolBrokerService _esql_pool =
PoolBrokerService.getInstance();
                                              ^
124: Class _www._tv._xml._search._show._process. EsqlConnection already
defined in
/home/tomcat/repository/_www/_tv/_xml/_search/_show/_process.java.
      class EsqlConnection {
            ^
124: Duplicate inner class declaration: nested type
_www._tv._xml._search._show._process. EsqlConnection is already defined in
this scope.
      class EsqlConnection {
            ^
134: Class _www._tv._xml._search._show._process. EsqlQuery already defined
in /home/tomcat/repository/_www/_tv/_xml/_search/_show/_process.java.
      class EsqlQuery {
            ^
134: Duplicate inner class declaration: nested type
_www._tv._xml._search._show._process. EsqlQuery is already defined in this
scope.
      class EsqlQuery {
            ^
5 errors


Why is there a duplicate variable declaration? With Cocoon 1.8 it worked
fine...

.andi




EQSL with a custom logicsheet

Posted by Andreas Neuenschwander <an...@andi.ch>.
I'd like to transform a given string through my own logicsheet.
If I get this string with the esql command 'getString' it doesn't
seems to work.


Error Message in Case 1:

java.lang.Exception: XSP Java Compiler: Compilation failed for _index.java
382: Missing term.
      			StringConversion.getFirstToken(, ":")
                                                       ^
1 error

Which means, I don't get back the value from the esql lib. But why?


Case 1:
... 
  <esql:row-results>
    <myspace:id>
      <esql:getString column="id">
    </myspace:id>
    <myspace:row1>
      <esql:getString column="row1">
    </myspace:row1>
    <myspace:row2>
      <customlib:getFirstElement token=":">
        <customlib:text>
          <esql:getString column="row2">       <--// subject of question
        </customlb:text>
      </customlib:getFirstElement>
    </myspace:row2>
  ...
  </esql:row-results>



If I test my custom taglib with a fixed string it all works well, 
and returns only the string 'firsttoken':

Case 2:
... 
  <esql:row-results>
    <myspace:id>
      <esql:getString column="id">
    </myspace:id>
    <myspace:row1>
      <esql:getString column="row1">
    </myspace:row1>
    <myspace:row2>
      <customlib:getFirstElement token=":">
        <customlib:text>
          firsttoken:secondtoken            <--// subject of question
        </customlb:text>
      </customlib:getFirstElement>
    </myspace:row2>
  ...
  </esql:row-results>      


If I don't make a process through my taglib it works well too, and 
the esql call gives me back the whole string from the database:

Case 3:
... 
  <esql:row-results>
    <myspace:id>
      <esql:getString column="id">
    </myspace:id>
    <myspace:row1>
      <esql:getString column="row1">
    </myspace:row1>
    <myspace:row2>
      <esql:getString column="row2">       <--// subject of question
    </myspace:row2>
  ...
  </esql:row-results>      


What I am doing wrong? How can I take control over which logicsheet gets
first executed before the other?

-andi