cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Philippe Guillard <pguill...@soociety.com>
Subject ESQL result pushed in sendmail in same XSP page?
Date Wed, 17 Mar 2004 08:21:03 GMT
Hi all,
I make the serverpage generator treat ESQL and sendmail in the same
.xsp, and i'd like to pass the parameter i get from my ESQL statement in
the sendmail generation.

Question : 
- I'd like to know if this is possible?
- If not, what solution could avoid this situation
(XSP Action for ESQL  before sendmail generation?)
 
Regards,

Phil

My Sample : below i get the user's password first with ESQL then
sendmail it to the user, here the error is "yourpassword cannot be
resolved":

<?xml version="1.0" encoding="UTF-8"?>
<xsp:page language="java"
          xmlns:xsp="http://apache.org/xsp"
          xmlns:xsp-request="http://apache.org/xsp/request/2.0"
          xmlns:esql="http://apache.org/cocoon/SQL/v2"
         
xmlns:sendmail="http://apache.org/cocoon/sendmail/1.0">          
<page>  
  <title>title</title> 
   <esql:connection>
     <esql:pool>mypool</esql:pool>
       <esql:execute-query>,
         <esql:query>select password from USER where
email=<esql:parameter><xsp-request:get-parameter
name="email"/></esql:parameter></esql:query>
         <esql:results>
              <esql:row-results>
                  <xsp:logic>
                     String yourpassword = new String(<esql:get-string
column="password"/>);
                  </xsp:logic>         
              </esql:row-results>
          </esql:results>
          <esql:no-results>
          </esql:no-results>
       </esql:execute-query>
   </esql:connection>     
   <sendmail:send-mail>
      <sendmail:smtphost>localhost</sendmail:smtphost>
      <sendmail:from>cocoon@localhost</sendmail:from>
      <sendmail:to><xsp-request:get-parameter
name="email"/></sendmail:to>
      <sendmail:subject><xsp:expr>subject</xsp:expr></sendmail:subject>
     
<sendmail:body><xsp:expr>yourpassword</xsp:expr></sendmail:body> 
    
   </sendmail:send-mail>
</page>
</xsp:page>





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message