I’m really sorry, but I need to post below Java code. Which won’t work although it is written in JAVA.
Please help me find that error, which is probably placed in line lista.add..., described as Empty string, parse error.
List<Pair<Place,TicketType>> lista = new LinkedList();
for ( String pair: request.getParameter("miejsca").split(" ") )
{
lista.add(new Pair<Place,TicketType>(place_local.getPlace(Integer.parseInt(pair.split(":")[0].trim())),tt_local.getTicketType(Integer.parseInt(pair.split(":")[1].trim()))));
}
try
{
reservation_local.addReservation(lista,id,m.getUser((String)session.getAttribute("name")).id);
}
catch (MySQLException e)
{
out.println(e.getMessage());
}
I’d recommend you split the String in a separate step prior to the iteration. Also, validate that you really do receive the expected parameter from the HTTP request in the first place.