Hello,
Jooby is an awesome Java micro framework. Developing apps with it is amazing!
I have the following code below. If someone goes to /shop/order manually then their cart will be 0 in which case I want to redirect them back to the cart vs. letting them through. Problem is I cannot see how MVC could redirect the URI. Any ideas?
Thanks in advance!
--Nikolaos
@GET
@Path("/shop/order")
public ModelAndView renderOrder(Context ctx) {
ModelAndView mvc = new ModelAndView("web/shop-order.hbs");
this.setup(mvc, PAGE_ORDER);
mvc.put("showFooter", true);
Cart cart = this.getClientSessionCart(ctx);
//if (cart.getTotal().equals("0")) {
//return ctx.sendRedirect("/shop/cart"); <== What I want to do but does not compile
//}
mvc.put(PAGE_CART_NAME, cart);
return mvc;
}