August 2018
Intermediate to advanced
314 pages
8h 9m
English
The HelloWorldServlet class is a servlet class that responds to requests sent to the /helloworld/annotation path. This class has a doGet(HttpServletRequest request, HttpServletResponse response) method that responds to all GET requests. After this method is processed, a validation of authentication is done, and if the user is associated with the user role, the method is processed. If not, the dialog box is returned to the user:
import javax.annotation.security.DeclareRoles;import javax.servlet.ServletException;import javax.servlet.annotation.HttpConstraint;import javax.servlet.annotation.ServletSecurity;import javax.servlet.annotation.WebServlet;import javax.servlet.http.HttpServlet;import javax.servlet.http.HttpServletRequest ...
Read now
Unlock full access