I'm calling my DAO and I'm looking to get a unique result. I'm trying to figure what to do when there is no result with that ID.
Is this how?
-Avinash
Code:protected ModelAndView handle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, java.lang.Object command, BindException bindException) throws java.lang.Exception { DisplayProductCommand displayCommand = (DisplayProductCommand) command; Map myModel = new HashMap(); Product myProduct; myProduct = getProductDao().getProduct(displayCommand.getId()); if(myProduct!=null){ myModel.put("product",myProduct); return new ModelAndView("product_detail", "model", myModel); } else{ return new ModelAndView("error","message","Invalid Product ID!"); } }


Reply With Quote
.
