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 21:49:30 GMT
Dave,

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>");

How can I achieve the Redirection to another URL based on a values of
session attribute? That's, in gist, what I'm trying to achieve. 

Thanks,

-----Original Message-----
From: Dave [mailto:snoopdave@gmail.com] 
Sent: Friday, November 30, 2007 3:43 PM
To: user@roller.apache.org
Subject: Re: inserting java code in templates

Hmm... I'm not sure we support that.

Try "pageContext" which might give you a JSP PageContext from which
you can get the response.

You might run into problems if you write to the response. I have never
tried that.

- Dave



On Nov 30, 2007 4:19 PM, Prabhu Patil <ppatil@digitas.com> wrote:
> Dave,
>
> Sorry, I need the Response object, not the request.
>
> Thanks
>
> -----Original Message-----
> From: Dave [mailto:snoopdave@gmail.com]
> Sent: Friday, November 30, 2007 3:17 PM
> To: user@roller.apache.org
> Subject: Re: inserting java code in templates
>
>
> On Nov 30, 2007 4:12 PM, Prabhu Patil <ppatil@digitas.com> wrote:
> > I'm almost there, but for one last thing. I need the
> HTTPServletResponse
> > object in the new Model object I wrote. What's the key to retrieve
> > response object from Roller's params Map?
>
> The example I sent shows exactly how to do that:
>    http://tinyurl.com/2pnpn3
>
> The param name is "request"
>
>
> > Thanks so much.
>
> Sure thing.
>
> - Dave
>

Mime
View raw message