Reputation: 388
I'm generating a report with JasperReports in a new tab in PDF format, using Spring Boot 2.0.1, everything is working as expected.
But I want change the title and icon of the pages that reports are generated, because it is getting the default icon of spring, and the title is getting the controller mapping.
Image of what is going on:
OBS.: as you know, Spring losts the integration with JasperReports, so in my controller I'm returning a byte[] instead of a modelAndView.
@PostMapping("/filtro")
public ResponseEntity<byte[]> gerarRelatorio(Principal principal, IncidenciaLista conteudo) throws Exception{
UsuarioSistema us = (UsuarioSistema) ((Authentication) principal).getPrincipal();
byte[] relatorio = relatorioService.gerarRelatorioFiltrado(us.getUsuario().getEmpresa().getNome(), conteudo.getNomeProjeto(), conteudo.getLista());
return ResponseEntity.ok()
.header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_PDF_VALUE)
.body(relatorio);
}
Upvotes: 0
Views: 1126
Reputation: 11411
Simply add an favicon.ico
image to src/main/resources/favicon.ico
The image should meet the following criteria,
name - favicon.ico
size - 32x32 or 16x16 pixels
Color - 265
Upvotes: 1