Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created September 4, 2019 21:36
Show Gist options
  • Save parzibyte/c9d164903faff43a72edbfa17c403288 to your computer and use it in GitHub Desktop.
Save parzibyte/c9d164903faff43a72edbfa17c403288 to your computer and use it in GitHub Desktop.
private ArrayList<ProductoParaVender> obtenerCarrito(HttpServletRequest request) {
ArrayList<ProductoParaVender> carrito = (ArrayList<ProductoParaVender>) request.getSession().getAttribute("carrito");
if (carrito == null) {
carrito = new ArrayList<>();
}
return carrito;
}
private void guardarCarrito(ArrayList<ProductoParaVender> carrito, HttpServletRequest request) {
request.getSession().setAttribute("carrito", carrito);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment