In the first line of the servlet file, why do we write “package io.happycoding.servlets” ?
Why not “package WEB-INF.classes.io.happycoding.servlets”?
It all comes down to the classpath. Java will be looking for classes inside the WEB-INF/classes directory, so all of our package names are relative to that.
I like to start with a couple command line examples like this one, but after you understand the fundamentals I’d probably use something like Maven to handle all of the classpath stuff for you!