包含标签 java 的文章

Liberty Profile Tls V1 Gaps

Gap - TLS version 1.0/1.1 detected 如果在做security scan的时候,有这两个gap,需要修改两个地方 liberty profile server.xml add sslProtocol="TLSv1.2" to ssl <ssl id="defaultSSLConfig" sslProtocol="TLSv1.2" keyStoreRef="defaultKeyStore" securityLevel="CUSTOM" enabledCiphers="TLS_RSA_WITH_AES_128_CBC_SHA TLS_RSA_WITH_AES_128_CBC_SHA256 "/> server.env add JVM_ARGS=-Dhttps.protocols=TLSv1.2……

阅读全文

添加第三方jar到Spring Boot application

背景 有时候需要添加第三方的jar包到spring boot工程中,因为不能从maven repository直接下载,所以需要包含在代码库中。 一般需要在 src/main 目录下,可以建个新目录 lib, 然后把jar文件放到这个目录下,也就是 src/main/lib下. 然后在pom.xml中需要添加 group……

阅读全文

Spring Boot File Download

spring boot application 提供下载的代码,可以返回一个Resource @RestController @RequiredArgsConstructor @RequestMapping("/api") public class ReportController { @GetMapping(value = "/filedownload") public ResponseEntity<InputStreamResource> downloadFile(HttpServletRequest request) { // ....................... // ....................... // ....................... ByteArrayInputStream stream = xxxxxx;// get the stream return ResponseEntity.ok().contentType(MediaType.APPLICATION_OCTET_STREAM) .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=file.xlsx") .body(new InputStreamResource(stream)); } }……

阅读全文