In an HTML file, I wrote the following AJAX request:
var server_query = new XMLHttpRequest();
server_query.open("GET", "try.jsp?name=Adam", false);
server_query.send();
a = server_query.responseText;
alert(a);
And in my JSP file I wrote the following:
<%@ page import="java.util.*,java.io.*" %>
<%
PrintWriter reply = response.getWriter();
String name = request.getParameter("name");
reply.print(name);
%>
Now when I run my file in the browser, instead of showing the name, the alert shows the entire JSP code. I'm not able to figure out what's wrong.
You have either not configured your HTTP server to process that file for JSP directives, or you aren't using an HTTP server that supports JSP at all.