Olá galera estou com o seguinte problema, quando tento utilizar o printerJob a janela de diálogo da impressão não aparece, detalhe só nas aplicações web que não, e mais outro detalhe, quando uso alguma IDE ele funciona… o código ta ai a baixo valew!
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<form action="actIndex.jsp" name="frm">
<input type="text" name="teste">
<input type="submit" value="Enviar">
</form>
</body>
</html>
<%@ page import="java.awt.*"%>
<%@ page import="java.awt.print.*"%>
<%
String str = request.getParameter("teste");
out.println(str);
PrinterJob job = PrinterJob.getPrinterJob();
if (job.printDialog()) {
try {
job.print() ;
}
catch (PrinterException e) { /*...*/}
}
%>