Skip to main content

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.

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 — 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:
http://localhost:8080/ServidorTiendaPlayeras/ProductoServlet

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.
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Access-Control-Allow-Headers: Content-Type
For browser preflight checks, the servlet implements 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:
Content-Type: application/json;charset=UTF-8

Producto Object

Every endpoint that returns product data uses the following Producto model:
id
integer
Auto-increment primary key. Assigned by the database on insertion — do not provide this field when creating a product.
nombre
string
The product name, e.g. "Playera Oversize Anime".
talla
string
The t-shirt size. Accepted values: CH, M, G, XG.
precio
number
The price in Mexican Pesos (MXN), stored as a double.
stock
integer
The number of units currently available in inventory.

Endpoints Summary

MethodPathActionDescription
GET/ProductoServletList all products
POST/ProductoServletaccion=crearCreate a product
PUT/ProductoServletUpdate a product
DELETE/ProductoServletDelete a product
POST/ProductoServletaccion=venderSell a product (decrement stock)
OPTIONS/ProductoServletCORS 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.

Build docs developers (and LLMs) love