I\'m trying to create a link to open a new page in a different window/tab and display some msg from backing bean but fail to do it, wonder know why?
here is my xhtml
Try this in your controller code, it worked for me perfectly.
HttpServletResponse res = (HttpServletResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse();
HttpServletRequest req = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
String uri = req.getRequestURI();
res.getWriter().println("<script>window.open('" + myUrl + "','_blank', 'location=yes,height=600,width=800,scrollbars=yes,status=yes'); window.parent.location.href= '"+uri+"';</script>");
FacesContext.getCurrentInstance().responseComplete();