roller-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Prabhu Patil" <ppa...@digitas.com>
Subject RE: inserting java code in templates
Date Fri, 30 Nov 2007 22:30:00 GMT
Jeff,
I'm going to examine session on the server side using a method of the
Model object and going to return a string to the template.

Then a java script will consume this string on the client side and
redirect to another URL if necessary.

Thanks

-----Original Message-----
From: Jeffrey Blattman [mailto:jeffrey.blattman@gmail.com] 
Sent: Friday, November 30, 2007 4:21 PM
To: user@roller.apache.org
Subject: Re: inserting java code in templates

how will you inspect the values of a session attribute on the client  
side? i assume by "session" prabhu meant http session.

On Nov 30, 2007, at 2:09 PM, Dave wrote:

> On Nov 30, 2007 4:49 PM, Prabhu Patil <ppatil@digitas.com> wrote:
>> I already tried the pageContext and getResponse() method of it. It  
>> did
>> not work. Roller just painted the current page, but did not  
>> redirect to
>> another page that I was hoping to see. Below are code snippets.
>>
>> this.pageContext = (PageContext)params.get("pageContext");
>> this.resp = (HttpServletResponse)pageContext.getResponse();
>> ....
>>
>> resp.sendRedirect(redirectURL);
>
>> Another approach of writing to response also gave the same result.  
>> Below
>> is the code snippet:
>>
>> pageContext.getOut().println("<script
>> type=\"text/javascript\">document.location.href='"
>>                                                 + redirectURL +
>> "';</script>");
>
>
> A client-side redirect should work, but there's no need to use
> pageContext.getOut().
> Just put the Javascript right into the page template.
>
> - Dave

Mime
View raw message