i have such a RestController
@Controller
public class ExchangeRateController {
private final static Logger LOGGER = LoggerFactory.getLogger(ExchangeRateController.class);
@GetMapping(value = "/current")
public ModelAndView geExchangeRate(){
ModelAndView modelAndView = new ModelAndView();
modelAndView.setViewName("Response.html");
modelAndView.addObject("resultUrl",url);
modelAndView.addObject("embedUrl",embedUrl);
return modelAndView;
}
}
Inside, I get the URL of the image and want to embed it using Model on my page.But it gives me an error 404 or an empty page, although if to take these addresses and just write in an html file, then everything works.How can this be done so that they are added to the place of scr and href?
<!DOCTYPE HTML>
<html>
<head>
</head>
<body>
<iframe src="${resultUrl}" width="980" height="560" frameBorder="0" class="giphy-embed" allowFullScreen></iframe>
<p><a href="${embedUrl}">text</a></p>
</body>
</html>
Use
th:src
andth:href
.