我已经用Java复制了一个非常简单的applet(仅是一条书面消息)并创建了一个jar文件。我使用以下代码调用了jar文件,但是当我在浏览器中打开文件时,什么都没有出现(除了标题)。我在犯什么新手错误?
private ResponseEntity<String> exchange(String url, HttpMethod method, HttpEntity<?> httpEntity,
Class<?> class1, Map<String, String> paramMap) {
ResponseEntity<String> responseEntity = null;
try {
responseEntity = restTemplate.exchange(url, method, httpEntity, String.class, paramMap);
}catch(HttpClientErrorException e) {
responseEntity = new ResponseEntity<>(e.getResponseBodyAsString(), HttpStatus.BAD_REQUEST);
}catch(HttpServerErrorException e) {
responseEntity = new ResponseEntity<>(e.getResponseBodyAsString(), HttpStatus.INTERNAL_SERVER_ERROR);
throw e;
}catch(Exception e) {
responseEntity = new ResponseEntity<>(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR);
throw e;
}
return responseEntity;
}