I am working on a servlet class but I am getting the following errors. From my research that I have made I realized that it is require for me to do some imports. The problem is I cannot add imports. This is my servlet class.
public class School extends HttpServlet {
public void doGet(HtttpServletRequest request, HttpServletResponse response) throw ServletException, IOException {
String name = request.getParameter('name');
PrintWriter writer = response.getWriter();
writer.ptintln("<html><body>" + new Date() +"<html></html>");
}
}
You can add imports at the beginning of the page like depicted below
import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;
import javax.ejb.EJB;
import javax.security.auth.message.callback.PrivateKeyCallback.Request;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
Hover the cusor on the part where it indicates there is an error. you will see a menu with the import option or some other suggestions that you can try.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With