I'm getting a java.lang.NoSuchMethod error when executing the following:
// Retrieve the context for this object
HttpSession session = req.getSession();
ServletContext context = session.getServletContext();
The error seems to be happening on the call to getServletContext()
The Class that this incures in is instantiated from a servlet and passed the
HttpServletRequest on the call to execute(...) method.
The Class is defined as so:
class MainCommand implements Command {
private String next;
public MainCommand(String next) {
this.next = next;
}
public String execute(HttpServletRequest req)
throws CommandException {
// Retrieve the context for this object
HttpSession session = req.getSession();
ServletContext context = session.getServletContext();
return next;
}
}
Does any one have any clue why this would be happening? The call according
to the JDOC is valid.
-Ben