Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String queryString = req.getQueryString().split("=")[1];
- // tuk ako imam nqkolko dumi s interval m/u tqh slaga %20 sled kato splitnem sas =
- ProductServiceModel modelName = this.productService.getProductByName(URLDecoder.decode(queryString, StandardCharsets.UTF_8));
- // i za tova tuka izpolzvam URLDecoder.decode i pravi black magic i go opravq...
- ProductDetailsViewModel productDetailsViewModel = this.modelMapper.map(modelName, ProductDetailsViewModel.class);
- String htmlContent = this.htmlReader
- .readHtmlFile(PRODUCT_DETAILS_HTML_FILE_PATH)
- .replace("{{productName}}", productDetailsViewModel.getName())
- .replace("{{productDescription}}", productDetailsViewModel.getDescription())
- .replace("{{productType}}", productDetailsViewModel.getType());
- resp.getWriter().println(htmlContent);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement