I want to get the list of all the printers including network printers. It worked and got all the printers when the project was run on eclipse. But when i deployed the war in tomcat host manager and it loaded only the local printers. My code is this.
public static List<PrinterBean> ConnectedPrinters()
{
List<PrinterBean> list=new ArrayList<PrinterBean>();
PrintService[] printServices = PrintServiceLookup.lookupPrintServices(null, null);
for (PrintService printer : printServices){
PrinterBean pb=new PrinterBean();
pb.setPrinters(printer.getName());
list.add(pb);
}
return list;
}