How to redirect programmatically from Java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How to redirect programmatically from Java

Vinay Agarwal
Hello,

 

What's the best way to redirect programmatically from a Java event handler?
There is a RequestHandler.callRedirect function but it is private. No other
function seems to offer similar functionality. Thanks in advance.

 

Regards,

Vinay Agarwal

 

Reply | Threaded
Open this post in threaded view
|

Re: How to redirect programmatically from Java

David E Jones-2
Use the HttpServletResponse object.

-David


Vinay Agarwal wrote:

> Hello,
>
>  
>
> What's the best way to redirect programmatically from a Java event handler?
> There is a RequestHandler.callRedirect function but it is private. No other
> function seems to offer similar functionality. Thanks in advance.
>
>  
>
> Regards,
>
> Vinay Agarwal
>
>  
>
>

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How to redirect programmatically from Java

Leon Torres-2
What happens then to the <request-map> for this request after the redirect is
done with HttpServletRequest?  Will the <responses> be ignored or will they be
checked after the next request is processed?

- Leon



David E. Jones wrote:

> Use the HttpServletResponse object.
>
> -David
>
>
> Vinay Agarwal wrote:
>> Hello,
>>
>>  
>>
>> What's the best way to redirect programmatically from a Java event
>> handler?
>> There is a RequestHandler.callRedirect function but it is private. No
>> other
>> function seems to offer similar functionality. Thanks in advance.
>>
>>  
>>
>> Regards,
>>
>> Vinay Agarwal
>>
>>  
>>
>>
Reply | Threaded
Open this post in threaded view
|

Re: How to redirect programmatically from Java

David E Jones-2
You should use the "none" response type if an event will be handling the response...

If you don't you'll most likely get some sort of error, depending on what you've configured to go after that.

BTW, shameless plug: this is included in the Advanced Framework training, and the new screen-recorded videos (like the new Framework Introduction ones that are free on ofbiz.org) that cover all of this should be out soon (in the next few days...).

-David


Leon Torres wrote:

> What happens then to the <request-map> for this request after the
> redirect is done with HttpServletRequest?  Will the <responses> be
> ignored or will they be checked after the next request is processed?
>
> - Leon
>
>
>
> David E. Jones wrote:
>> Use the HttpServletResponse object.
>>
>> -David
>>
>>
>> Vinay Agarwal wrote:
>>> Hello,
>>>
>>>  
>>>
>>> What's the best way to redirect programmatically from a Java event
>>> handler?
>>> There is a RequestHandler.callRedirect function but it is private. No
>>> other
>>> function seems to offer similar functionality. Thanks in advance.
>>>
>>>  
>>>
>>> Regards,
>>>
>>> Vinay Agarwal
>>>
>>>  
>>>
>>>

smime.p7s (4K) Download Attachment