我已经看到两种处理具有属性的枚举的方法.这个比那个好吗?
作为财产:
public enum SEARCH_ENGINE {
GOOGLE("http://www.google.com"),
BING("http://www.bing.com");
private final String url;
private SEARCH_ENGINE(String url) {
this.url = url;
}
public String getURL() {
return url;
}
}
Run Code Online (Sandbox Code Playgroud)
作为一种方法:
public enum SEARCH_ENGINE {
GOOGLE {
public String getURL() {return "http://www.google.com";}
},
BING {
public String getURL() {return "http://www.bing.com";}
};
public abstract String getURL();
}
Run Code Online (Sandbox Code Playgroud) 我在文件夹C:\ DemoFilesExcel\demo1.xlsx和C:\ DemoFilesExcel\demo2.xlsx中有两个xlsx文件.
我想创建一个新的xlsx C:\ DemoFilesExcel\merged.xlsx,它将这两个文件作为merged.xlsx工作簿中的两个工作表.
这是在java中使用apache POI完成的.任何想法怎么做
我想使用以下 Angular 6 代码实现文件下载:
休息API:
private static final Logger LOG = LoggerFactory.getLogger(DownloadsController.class);
private static final String EXTERNAL_FILE_PATH = "/Users/test/Documents/blacklist_api.pdf";
@GetMapping("export")
public ResponseEntity<InputStreamResource> export() throws IOException {
ClassPathResource pdfFile = new ClassPathResource(EXTERNAL_FILE_PATH);
HttpHeaders headers = new HttpHeaders();
headers.add("Cache-Control", "no-cache, no-store, must-revalidate");
headers.add("Pragma", "no-cache");
headers.add("Expires", "0");
return ResponseEntity.ok().headers(headers).contentLength(pdfFile.contentLength())
.contentType(MediaType.parseMediaType("application/pdf"))
.body(new InputStreamResource(pdfFile.getInputStream()));
}
Run Code Online (Sandbox Code Playgroud)
服务:
import {Component, OnInit} from '@angular/core';
import {DownloadService} from "../service/download.service";
import {ActivatedRoute, Router} from "@angular/router";
import {flatMap} from "rxjs/internal/operators";
import {of} from "rxjs/index";
import { map } from 'rxjs/operators';
@Component({ …Run Code Online (Sandbox Code Playgroud) 有没有办法在JBoss 7.1.1中记录HTTP post数据?
是否在日志配置中设置为DEBUG的类将输出此类?
java ×4
angular ×1
angular6 ×1
apache-poi ×1
core ×1
enumeration ×1
enums ×1
jboss ×1
jboss7.x ×1
spring ×1
spring-boot ×1