java - PrintServiceLookup.lookupPrintService solution in JBoss AS 7 -
i trying print pdf document jsf web application.
when call method findprinter()
main method, printservices
found, when call method web page printservice
not found. code mentioned below..
public static void main(final string[] args) throws exception { printtest printtest = new printtest(); printtest.findprinter(); } public void findprinter() { printservice[] printservices = printerjob.lookupprintservices(); system.out.println("print services length :: " + printservices.length); (printservice printservice : printservices) { system.out.println("printservice :: " + printservice); } <h:form> <p:commandbutton value="print" action="#{printtest.findprinter()}"/> </h:form>
any suggestions...
add tag in modules/sun/jdk/main/module.xml of jbossas mentioned: path name="sun/print"
open resources.jar jre, , extract
meta-inf/services/javax.print.printservicelookup , copy location modules/sun/jdk/main/service-loader-resources/meta-inf/services of jbossas.restart jboss , run application.
Comments
Post a Comment