cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Terry Paddy" <te...@rostersetc.com>
Subject Cocoon-WAP-Nokia7110
Date Sun, 18 Jun 2000 21:59:13 GMT
Hi Guys,

Sorry to ask WAP questions on the Cocoon list again, but if I ask them
elsewhere "they" blame Cocoon first. I know Cocoon is not the problem!

The problem is, I can't seem to pass parameters from one deck to another on
the real phone or on the emulator at www.yospace.com, it works fine on the
Nokia 1.3b toolkit and it works fine if I use an HTML stylesheet instead of
a WML one. It is *not* a syntax or programming problem because I can replace
the parameters with "hard-wired" values and all works fine.

Basically I tracked it to the "request.getParameter("var1")" statement.

I post two variables from "Deck 1" as follows
  <anchor>POST this
     <go method="post" href="postresult.xml ">
       <postfield name="var1" value="$(var1)"/>
       <postfield name="var2" value="$(var2)"/>
     </go>
  </anchor>

The postresult.xml file is
------------------------------
<?cocoon-process type="xsp"?>
<?xml-stylesheet href="postresult.xsl" type="text/xsl" media="wap"?>
<?cocoon-process type="xslt"?>

<xsp:page
  language="java"
  xmlns:sql="http://www.apache.org/1999/SQL"
  xmlns:xsp="http://www.apache.org/1999/XSP/Core"
>
<xsp:logic>
   private String normalize(String string) {
   if (string == null) return "";
   else return string;
  }
</xsp:logic>
   <page>
	<var1><xsp:expr>normalize(request.getParameter("var1"))</xsp:expr></var1>
	<var2><xsp:expr>normalize(request.getParameter("var2"))</xsp:expr></var2>
   </page>
</xsp:page>
---------------------------------
The stylesheet just formats the output to WML. If I replace
<xsp:expr>normalize(request.getParameter("var1"))</xsp:expr> with a
hard-wired value, it displays that OK, but the above code wont display
anything, it gives a page error. I can pull other values out of the request
object as I have successfully output the results of the following xsp sample

   <element name="Request
method"><xsp:expr>normalize(request.getMethod())</xsp:expr></element>
   <element name="Request
URI"><xsp:expr>normalize(request.getRequestURI())</xsp:expr></element>
   <element name="Request
protocol"><xsp:expr>normalize(request.getProtocol())</xsp:expr></element>
   <element name="Servlet
path"><xsp:expr>normalize(request.getServletPath())</xsp:expr></element>
   <element name="Path
info"><xsp:expr>normalize(request.getPathInfo())</xsp:expr></element>
   <element name="Path
translated"><xsp:expr>normalize(request.getPathTranslated())</xsp:expr></ele
ment>
   <element name="Query
string"><xsp:expr>normalize(request.getQueryString())</xsp:expr></element>
   <element name="Content
length"><xsp:expr>request.getContentLength()</xsp:expr></element>
   <element name="Content
type"><xsp:expr>normalize(request.getContentType())</xsp:expr></element>
   <element name="Server
name"><xsp:expr>normalize(request.getServerName())</xsp:expr></element>
   <element name="Server
port"><xsp:expr>request.getServerPort()</xsp:expr></element>
   <element name="Remote
user"><xsp:expr>normalize(request.getRemoteUser())</xsp:expr></element>
   <element name="Remote
address"><xsp:expr>normalize(request.getRemoteAddr())</xsp:expr></element>
   <element name="Remote
host"><xsp:expr>normalize(request.getRemoteHost())</xsp:expr></element>
   <element name="Authorization
scheme"><xsp:expr>normalize(request.getAuthType())</xsp:expr></element>

Yospace has a posttest example to ensure that your phone and gateway handle
the post method OK, and my phone does that test fine, but I can't run the
above simple test successfully.

What on earth am I doing wrong? Any ideas? Thanks ...

Regards ... Terry

Terry Paddy
------------------------------------------
RostersEtc Ltd, Christchurch, NEW ZEALAND
Ph: +64 3 3557245    Fax: +64 3 3557 224
      mailto:terry@rostersetc.com
       http://www.rostersetc.com
          Mobile 021 359 868
------------------------------------------


Mime
View raw message