0
package com.exjava.web;

import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServlet;
import java.io.IOException;

public class Test extends HttpServlet {
    @Override
    public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException {
        req.getSession();
    }
}
java: cannot find symbol
  symbol:   method getSession()
  location: variable req of type javax.servlet.ServletRequest
I don't know why but I cannot use getSession(). It just turns into red. 
I remember I didn't have any problem with it earlier but all of a sudden it became unusable.
Does anybody know how to fix this?
Ainsof26
  • 9
  • 3

0 Answers0