The ProductoServlet is a single Jakarta EE 10 Servlet that exposes a REST-style API for managing t-shirt products in the Tienda de Playeras application. It handles five HTTP methods —Documentation Index
Fetch the complete documentation index at: https://mintlify.com/LucaXGit/proyecto-final-jaz/llms.txt
Use this file to discover all available pages before exploring further.
GET, POST, PUT, DELETE, and OPTIONS — all routed through a single endpoint mounted on the ServidorTiendaPlayeras web application.
Base URL
All requests are made to the following base URL:CORS
The servlet adds CORS headers to every response, including error responses. This allows browser-based clients running on any origin to call the API directly.doOptions(), which returns HTTP 200 with the CORS headers and an empty body.
Content Type
All responses are returned as JSON with UTF-8 encoding:Producto Object
Every endpoint that returns product data uses the followingProducto model:
Auto-increment primary key. Assigned by the database on insertion — do not provide this field when creating a product.
The product name, e.g.
"Playera Oversize Anime".The t-shirt size. Accepted values:
CH, M, G, XG.The price in Mexican Pesos (MXN), stored as a
double.The number of units currently available in inventory.
Endpoints Summary
| Method | Path | Action | Description |
|---|---|---|---|
| GET | /ProductoServlet | — | List all products |
| POST | /ProductoServlet | accion=crear | Create a product |
| PUT | /ProductoServlet | — | Update a product |
| DELETE | /ProductoServlet | — | Delete a product |
| POST | /ProductoServlet | accion=vender | Sell a product (decrement stock) |
| OPTIONS | /ProductoServlet | — | CORS preflight |
This API has no authentication. It is designed exclusively for localhost development use. Do not expose
ServidorTiendaPlayeras on a public network without adding an authentication layer.