I am developing a web application and right now I am trying to "hide" the file name in the URL.
It is currently like that:
/localhost/test/faculty_searchstudents.jsp
I want to hide the file name. I have tried using requestdispatcher like that:
while (resultSet.next()) {
String first_name = resultSet.getString("firstname");
String last_name = resultSet.getString("lastname");
String email = resultSet.getString("email");
Object[] student = {first_name,last_name,email};
studentList.add(student);
}
session.setAttribute("studentObject",studentList);
RequestDispatcher dispatcher = getRequestDispatcher("faculty_searchstudents.jsp");
dispatcher.forward(request,response);
However when I run this code, it says that
"The method getRequestDispatcher(String) is undefined ".
I already import it at the top of the file like this :
<%@page import = "javax.servlet.*" %>
How do I hide the filename in the URL?