Pessoal estou com problema para seta um registro e mandar imprimir !
JSP<td align="center">
<form action="<c:url value="/clienteFisica/relatorioAcompanhamentoDeProcessosGeradosClienteFisico/${clienteFisica.clfiPkId}"/>" method="GET">
<input type="image" src="../img/imp.png" width="30" height="30" name="_method" value="GET"/>
</form>
</td>
@Get @Path("/clienteFisica/relClienteFisicoPessoaUnica")
public void relClienteFisicoPessoaUnica() {
}
public InputStreamDownload relClienteFisicoPessoaUnica()
throws JRException, SQLException, ClassNotFoundException, Exception {
InputStream file = getClass().getClassLoader().
getResourceAsStream("/br/com/catequese/relatorio/relClienteFisicoPessoaUnica.jasper");
ByteArrayOutputStream os = new ByteArrayOutputStream();
JasperRunManager.runReportToPdfStream(file, os, null, getConexao());
InputStream document = new ByteArrayInputStream(os.toByteArray());
return new InputStreamDownload(document, "application/pdf", "relClienteFisicoPessoaUnica.jasper", true, os.toByteArray().length);
}
ERRO :
HTTP Status 500 -
type Exception report
message
descriptionThe server encountered an internal error () that prevented it from fulfilling this request.
exception
java.lang.IllegalArgumentException: You can't use _method parameter on a GET request. Use POST instead.
note The full stack traces of the exception and its root causes are available in the GlassFish v3 logs.
GlassFish v3
Se eu usar POST ele da outro erro :
<td align="center">
<form action="<c:url value="/clienteFisica/relClienteFisicoPessoaUnica/${clienteFisica.clfiPkId}"/>" method="POST">
<input type="image" src="../img/imp.png" width="30" height="30" name="_method" value="POST"/>
</form>
</td>
HTTP Status 404 -
type Status report
message
descriptionThe requested resource () is not available.
GlassFish v3