Making deckbuilder not complain of server error in IE.

This commit is contained in:
marcins78@gmail.com
2011-09-06 23:29:38 +00:00
parent c0cdd0bbe0
commit abae927b96

View File

@@ -215,10 +215,10 @@ public class ServerResource {
@Path("/deck/{deckType}") @Path("/deck/{deckType}")
@POST @POST
@Produces(MediaType.APPLICATION_XML) @Produces(MediaType.APPLICATION_XML)
public void createDeck( public Document createDeck(
@PathParam("deckType") String deckType, @PathParam("deckType") String deckType,
@FormParam("participantId") String participantId, @FormParam("participantId") String participantId,
@FormParam("deckContents") String contents) { @FormParam("deckContents") String contents) throws ParserConfigurationException {
PlayerDAO playerDao = _lotroServer.getPlayerDao(); PlayerDAO playerDao = _lotroServer.getPlayerDao();
DeckDAO deckDao = _lotroServer.getDeckDao(); DeckDAO deckDao = _lotroServer.getDeckDao();
@@ -232,6 +232,15 @@ public class ServerResource {
sendError(Response.Status.BAD_REQUEST); sendError(Response.Status.BAD_REQUEST);
deckDao.setDeckForPlayer(player, deckType, deck); deckDao.setDeckForPlayer(player, deckType, deck);
DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
Document doc = documentBuilder.newDocument();
Element deckElem = doc.createElement("ok");
doc.appendChild(deckElem);
return doc;
} }
@Path("/collection/{collectionType}") @Path("/collection/{collectionType}")