Skip to content

Instantly share code, notes, and snippets.

Created September 4, 2019 21:36
What would you like to do?
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