Can't find the right way to get parameter value from the HttpRequest:
this is my JQuery file:
$(document).ready(function() {
var currBoard;
var currCell;
$(".cell").click(function() {
Cardboard = $ (this). attr ('name');
currCell = $(this).attr('id');
$.get('InGameServlet', function(responseText) {
$("#"+currCell).text(responseText);
alert("cell num:" + currCell + " Board: " + currBoard);
});
});
});
This is my Servlet:
@WebServlet(name = "InGameServlet", urlPatterns = {"/InGameServlet"})
public class InGameServlet extends HttpServlet {
protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
printSign(request.getParameter("currBoard"), request.getParameter("currCell"), response);
}
In debug mode i see that the values i get from the request are NULL!
What am i doing wrong?