roller-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeffrey Blattman <jeffrey.blatt...@gmail.com>
Subject Re: inserting java code in templates
Date Fri, 30 Nov 2007 22:12:26 GMT
are you sure the response hasn't been committed? if it has, i'd  
expect you to see an exception somewhere in the logs when you call  
redirect.

if it's already been committed, there's no much you can do about it.

how about putting another servlet in front of the roller action (?)  
servlet? then you can be assured that the response is clean at the  
time you inspect the session. probably not an ideal solution but all  
i can think of right now.

On Nov 30, 2007, at 1:49 PM, Prabhu Patil wrote:

> 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