0
私はjava spring technologyの新機能です。私は、Java Spring ControllerからモーダルでgetFunctionを呼び出す必要があります。Spring ControllerからJava Modal関数を呼び出しますか?
@RequestMapping(value = "/category/pagination-mobile/{categoryId}/{currentCity}", method = RequestMethod.POST)
@ResponseBody
public Map<String, String> paginationMobile(ModelMap model, @PathVariable int categoryId, @PathVariable int currentCity, HttpServletRequest request, HttpServletResponse response) {
Map<String, String> resp = new HashMap<>();
List<CityProduct> cityProducts = productService.getCityProductsForCategoryForWeb(categoryId, currentCity, 15, false);
request.setAttribute("products", cityProducts);
request.setAttribute("categoryId", categoryId);
System.out.println("--------------> " + cityProducts.getPrice());
String paginationFirstPage = getHtmlResponse(request, response, "/WEB-INF/jsp/catalog/_categoryFirst.jsp");
resp.put("html", paginationFirstPage);
return resp;
}
の.java
public class CityProduct implements Serializable {
public CityProduct(Product p, ProductOfCity pc) {
this.price = pc.getPrice();
}
public BigDecimal getPrice() {
return price;
}
public void setPrice(BigDecimal price) {
this.price = price;
}
}
私は、モーダルからすべての価格を取得したいです。春のコントローラですべての価格を取得する方法。
私は価格の整数を表示したいと思います。今は1299.0000です。しかし私は1299を表示したいと思います。私はすでにJSPでを使用しています。コントローラで検証できますか? –
あなたのコントローラで 'cityProduct.getPrice()。intValueExact()'を使用してください。 – Avinash