package com.agourlay.pomf.controller;

import java.io.IOException;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.agourlay.pomf.dao.Dao;

public class UpdatePostController extends HttpServlet {
		/**
		 * 
		 */
		private static final long serialVersionUID = 1L;

		public void doGet(HttpServletRequest req, HttpServletResponse resp)	throws IOException {
			Long id = Long.parseLong(req.getParameter("id"));
			String posXString = req.getParameter("positionX");
			String posYString = req.getParameter("positionY");
			
			Integer positionX = Integer.parseInt(posXString);
			Integer positionY = Integer.parseInt(posYString);
			
			Dao.INSTANCE.updatePosition(id, positionX, positionY);
			
			resp.setContentType("text/html");
			resp.setStatus(HttpServletResponse.SC_FOUND);	
			}
	}


@@ -503,85 +503,49 @@
 ));%0A
+%0A
 %09%09%09
-String posXString = req.getParameter(%22positionX%22);%0A%09%09%09String posYString = 
+Integer positionX = Integer.parseInt(
 req.
@@ -570,16 +570,13 @@
 tion
-Y
+X
 %22)
+)
 ;
-%0A%09%09%09
 %0A%09%09%09
@@ -583,33 +583,33 @@
 Integer position
-X
+Y
  = Integer.parse
@@ -616,71 +616,37 @@
 Int(
-posXString);%0A%09%09%09Integer positionY = Integer.parseInt(posYString
+req.getParameter(%22positionY%22)
 );%0A%09

clean code