01: /*
02: * PortletRedirect.java
03: *
04: * Created on October 10, 2006, 2:01 PM
05: *
06: * To change this template, choose Tools | Template Manager
07: * and open the template in the editor.
08: */
09:
10: package com.sun.portal.search.providers.faces;
11:
12: import javax.faces.context.FacesContext;
13: import javax.portlet.ActionResponse;
14:
15: public class PortletRedirect {
16:
17: /** Creates a new instance of PortletRedirect */
18: public PortletRedirect() throws Exception {
19: Class.forName("javax.portlet.ActionResponse");
20: }
21:
22: public boolean redirect(Object res, String url) throws Exception {
23: if (res instanceof ActionResponse) {
24: ActionResponse aRes = (ActionResponse) res;
25: FacesContext.getCurrentInstance().responseComplete();
26: aRes.sendRedirect(url);
27: return true;
28: }
29: return false;
30: }
31:
32: }
|