[Helma-user] Session.message with res.redirect()

Maksim Lin for technical support mailling lists maksim_lin at ngv.vic.gov.au
Fri Jan 25 05:03:15 CET 2008


Hi Tom,
You actually want res.message and not session.message.
The docs for it are at:
http://helma.zumbrunn.net/reference/res.html

or in your local helma install in:  
docs/framework/res.html

if you want to cache a message/variable for use any time in the user
session you need to assign it as a property of the session.data object

Maks.

> -----Original Message-----
> From: helma-user-bounces at helma.org 
> [mailto:helma-user-bounces at helma.org] On Behalf Of Austin, Tom
> Sent: Friday, 25 January 2008 14:02
> To: helma-user at helma.org
> Subject: [Helma-user] Session.message with res.redirect()
> 
> Hi,
> 
>  
> 
> I've been running into some problems with session.message.  
> It does not seem to survive res.redirect().  I see a similar 
> issue at http://www.helma.org/bugs/show_bug.cgi?id=245, but 
> that looks like it is fairly old.
> 
>  
> 
> Does anyone have any ideas what I'm doing wrong?  If I remove 
> the redirect, the message will display OK.  I'm using Helma v. 1.6.1.
> 
>  
> 
> Here are the files I have:
> 
>  
> 
>  
> 
> ::::::::::::::
> apps/test/Root/enter_message.hac
> ::::::::::::::
> if (req.isPost()) {
>   session.message = "***" + req.data.message_text + "<br />";
>   res.redirect(root.href());
> }
> renderSkin('enter_message');
> 
>  
> 
> ::::::::::::::
> apps/test/Global/enter_message.skin
> ::::::::::::::
> <html>
> <head>
>   <title>Enter a message</title>
> </head>
> <body>
>   <% response.message %>
>   <form action="enter_message" method="post">
>     <input type="text" name="message_text" encoding="form" />
>     <br />
>     <input type="submit" name="submit" />
>   </form>
> </body>
> </html>
> 
> 
> 
> ::::::::::::::
> apps/test/Root/main.hac
> ::::::::::::::
> renderSkin('main');
> 
> 
> ::::::::::::::
> apps/test/Global/main.skin
> ::::::::::::::
> <html>
> <head>
>   <title>Test app</title>
> </head>
> <body>
>   <h1>Demo app</h1>
>   <% response.message %>
>   <a href='enter_message'>Enter a new message</a> </body> </html>
> 
>  
> 
> -----------------
> 
>  
> 
> Thanks for any help you can give me.
> 
>  
> 
> --Tom
> 
>  
> 
> 


More information about the Helma-user mailing list