I am trying to build a web application based on
jsp ,ajax and servlets.The idea is to create a jsp that contains some options available for that user(previously he has to log in) and put a link on them.When the user clicks one of these links a xmlHttpRequest is send to the
servlet informing it about this event ,the servlet performs some operations, and replys back.In the onreadystatechange I check this reply and if it is the expected one, I have to delete that link. The problem is that what ever I do ,the responseText comes back containing the html from the page that sent the request. What is it wrong ?
and the part in servlet where I respond to the request:
if (comanda.equals("register"))
{
int id=Integer.parseInt(request.getParameter("id"));
response.setContentType("text/html");
response.setHeader("Cache-Control", "no-cache");
response.getWriter().println("true");
}
previously I store some data in the session.
[ November 23, 2008: Message edited by: Bear Bibeault ]