Community

PortletFilter: how to redirect in a Error Portlet

created by Raffaele Shmith in JBoss Portal - View the full discussion

Hello,

I'm using PortletFilter to incercept some PortletRequests and verify authorization. If the user isn't authorized i want redirect to an Errore (public) Portlet.

 

my code now is this:

 

public class AuthFilter implements RenderFilter, ActionFilter {
    private FilterConfig filterConfig = null;   
    public void init(FilterConfig filterConfig) throws PortletException {
        this.filterConfig = filterConfig;
    }   
    public void doFilter(RenderRequest req, RenderResponse resp, FilterChain filterChain) throws IOException, PortletException {
        if (filterConfig == null)
            return;       
        boolean auth=AuthManager.auth(req, resp); //check if the user is authotized
        if(!auth) {

          ???     //redirect to another portlet


        }
        filterChain.doFilter(req, resp);
    }

 

I hope that you can help me

Thanks

RM

Reply to this message by going to Community

Start a new discussion in JBoss Portal at Community