I'm not completely sure whether this is a Cocoon or Lenya problem, so
please bear with me.  I will copy the code here first.

In publication-sitemap.xmap:
...
    <map:pipeline>
      <map:match pattern="**/form-contact">
        <map:generate type="serverpages" src="xsp/tech/contact.xsp" />
        <map:serialize type="xml" />
      </map:match>
    </map:pipeline>
...

In contact.xsp:
<?xml version="1.0"?>

<xsp:page
    xmlns:xsp="http://apache.org/xsp";
    xmlns:xsp-request="http://apache.org/xsp/request/2.0";
    xmlns:eml="http://localhost/email";
>

  <xsp:logic>
    // Try 'A' -> causes "Language Exception"
    String email = request.getParameter( "remail" );

    // Try 'B' -> causes "Language Exception"   
    /*String email = <xsp-request:get-parameter name="remail"/>;*/

    // Try 'C' -> works just fine
    //String email = "email string";
  </xsp:logic>

  <eml:email>
    <eml:recip><xsp:expr>email</xsp:expr></eml:recip>
       <eml:sender>
       <eml:sname><xsp-request:get-parameter name="sname"/></eml:sname>
       <eml:semail><xsp-request:get-parameter name="semail"/></eml:semail>
       <eml:sphone><xsp-request:get-parameter name="sphone"/></eml:sphone>
     </eml:sender>
     <eml:message><xsp-request:get-parameter name="message"/></eml:message>
   </eml:email>

</xsp:page>

The Language Exception is as follows:
Language Exception at <map:serialize type="xml"> -
file:/home/dharmel/workspace/lenya_inside/lenya/pubs/outside_convert/publication-sitemap.xmap:127:37
at <map:generate type="serverpages"> -
file:/home/dharmel/workspace/lenya_inside/lenya/pubs/outside_convert/publication-sitemap.xmap:126:71
at <map:mount> -
file:/home/dharmel/workspace/lenya_inside/lenya/pubs/outside_convert/sitemap.xmap:55:111
at <map:mount> -
file:/home/dharmel/workspace/lenya_inside/global-sitemap.xmap:439:117

The basic idea is that I have a form submitting to "form-contact"
which is caught by the pipeline above.  I am taking baby steps to
create a process to email the form to a user-choosen email address.  I
want logic in the XSP to determine the email address as I do not want
the email addresses in the HTML.  So, I have a <select name="remail">
in my HTML with enumerated values.

Changing the serializer doesn't make a difference.  And interestingly
enough, the <xsp-request:get-parameter>'s outside of the <xsp:logic>
work perfectly.  I cannot figure out what is broken here.  Any help
would be greatly appreciated.  I know that I could use a work around
and just "get" the value of "remail" and then use and XSLT to do the
logic, but I don't like that solution.

--
Derek Harmel

Reply via email to