Friday, March 29, 2013

Calling Servlet From Bean


    public String callServlet(){
     
        FacesContext fc = FacesContext.getCurrentInstance();
        HttpServletRequest req = (HttpServletRequest)fc.getExternalContext().getRequest();
        HttpServletResponse resp=(HttpServletResponse)fc.getExternalContext().getResponse();

        try{
            ShowPdfServlet showPdf = new ShowPdfServlet();
            showPdf.doGet(req, resp);
        }catch(Exception e){
            System.out.println("ERROR");
        }
        return "";
    }
Related Posts Plugin for WordPress, Blogger...