Advertisement
Guest User

na rado chushkopeka ot minalia web

a guest
Oct 18th, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.88 KB | None | 0 0
  1. String queryString = req.getQueryString().split("=")[1];
  2. // tuk ako imam nqkolko dumi s interval m/u tqh slaga %20 sled kato splitnem sas =
  3.  
  4.         ProductServiceModel modelName = this.productService.getProductByName(URLDecoder.decode(queryString, StandardCharsets.UTF_8));
  5. // i za tova tuka izpolzvam URLDecoder.decode i pravi black magic i go opravq...
  6.  
  7.         ProductDetailsViewModel productDetailsViewModel = this.modelMapper.map(modelName, ProductDetailsViewModel.class);
  8.  
  9.         String htmlContent = this.htmlReader
  10.                 .readHtmlFile(PRODUCT_DETAILS_HTML_FILE_PATH)
  11.                 .replace("{{productName}}", productDetailsViewModel.getName())
  12.                 .replace("{{productDescription}}", productDetailsViewModel.getDescription())
  13.                 .replace("{{productType}}", productDetailsViewModel.getType());
  14.  
  15.         resp.getWriter().println(htmlContent);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement