JSF 1.2 to open external link in new tab. without distrubing current flow

29 Views Asked by At

I want to open https://stackoverflow.com/ in another tab but don't want to disturb current tab execution.

This is what I have tried -

try{
            ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
            externalContext.redirect("https://stackoverflow.com");
        } catch(Exception e){
            throw new FacesException("Redirection failed");
        }

currently, this code is opening this URL in the current tab only i.e. my current execution is going away.

0

There are 0 best solutions below