0 Replies Latest reply on Mar 19, 2010 11:39 AM by Raffaele Shmith

    PortletFilter: how to redirect in a Error Portlet

    Raffaele Shmith Newbie

      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