Never mind. My problem. It's <esql:row-results> NOT <esql:rowresults>. It
would be nice if there was some validation in the various namespaces like
esql, mail, etc. before you get to the code generator! It would have saved
me an hour or two!

 

> -----Original Message-----
> From: Sal Mangano [mailto:[EMAIL PROTECTED] 
> Sent: Friday, July 16, 2004 2:41 PM
> To: [EMAIL PROTECTED]
> Subject: Esql + mail in XSP
> 
> 
> I am trying to implement a "forgot password" page using XSP. 
> This seems like it should be a no brainer. I want to query my 
> user database using <esql:*> and retrieve the users email 
> address and password then mail it to the user using <mail:*>. 
> However, to do so, it would seem that I need to get the data 
> that esql returns into a variable. When I try to do this, the 
> code generator gets confused. Can this be done? If so, what 
> am I doing wrong?
> 
> The relevant snippit of xsp is as follows. I have tried 
> various permutations of this code with xsp:logic and 
> esql:rowresults used and not used but the results all fail to 
> generate java that compiles.
> 
> <esql:execute-query>
>     <esql:query>
>       SELECT firstname, lastname,  password FROM user, userdetail 
>       WHERE user.user = '<xsp:expr>user</xsp:expr>' 
>       AND user.user = userdetail.user  
>     </esql:query>
>     <esql:results>
>       <esql:rowresults>
>       <xsp:logic>
>           <!--PROBLEM IS HERE! --> 
>           firstname = <esql:get-string column="firstname"/> ;
>           lastname = <esql:get-string column="lastname"/> ;
>           password = <esql:get-string column="password"/> ;
>           <!-- body of mail message built up here ...
>             <--snip-->
>           -->
>         </xsp:logic>
>       </esql:rowresults>
>       <mail:send-mail>
>         <mail:charset>ISO-8859-1</mail:charset>
>         <mail:smtphost>smtp.somehost.com</mail:smtphost>
>         <mail:from>[EMAIL PROTECTED]</mail:from>
>         <mail:to><xsp:expr>user</xsp:expr></mail:to>
>         <mail:subject>Message from XXXXX</mail:subject>
>         <mail:body><xsp:expr>body</xsp:expr></mail:body>
>         <mail:on-success>
>           <passwordSent><xsp:expr>user</xsp:expr></passwordSent>
>         </mail:on-success>
>         <mail:on-error>
>           <ERROR>An error occurred while sending mail: 
> <mail:error-message/></ERROR>
>         </mail:on-error>
>       </mail:send-mail>          
>     </esql:results>
>     <esql:no-results>
> 
> ---------------------------------------------------------
> Sal Mangano
> Into Technology Inc.
> www.into-technology.com
> 
> Use XSLT? Try the XSLT Cookbook 
> http://www.oreilly.com/catalog/xsltckbk/  
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to