Class RolePrintingServlet
java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
org.jboss.as.test.integration.security.common.servlets.RolePrintingServlet
- All Implemented Interfaces:
jakarta.servlet.Servlet,jakarta.servlet.ServletConfig,Serializable
@WebServlet(urlPatterns="/printRoles")
@ServletSecurity(@HttpConstraint(rolesAllowed="*"))
public class RolePrintingServlet
extends jakarta.servlet.http.HttpServlet
A RolePrintingServlet gets list of role names as (GET) request parameters and returns a comma separated sublist of such role
names for which
HttpServletRequest.isUserInRole(String) returns true. Don't forget to declare the tested
roles in the web.xml file.- Author:
- Josef Cacek
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic StringName of the HTTP request parameter which holds a role name.static final StringThe default servlet path (used inWebServletannotation).Fields inherited from class jakarta.servlet.http.HttpServlet
LEGACY_DO_HEAD -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoGet(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp) Writes plain-text response with the comma-separated role names (subset of the names retrieved as GET parameters).Methods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, init, service, serviceMethods inherited from class jakarta.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
-
Field Details
-
PARAM_ROLE_NAME
Name of the HTTP request parameter which holds a role name. -
SERVLET_PATH
The default servlet path (used inWebServletannotation).- See Also:
-
-
Constructor Details
-
RolePrintingServlet
public RolePrintingServlet()
-
-
Method Details
-
doGet
protected void doGet(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp) throws jakarta.servlet.ServletException, IOException Writes plain-text response with the comma-separated role names (subset of the names retrieved as GET parameters).- Overrides:
doGetin classjakarta.servlet.http.HttpServlet- Parameters:
req-resp-- Throws:
jakarta.servlet.ServletExceptionIOException- See Also:
-
HttpServlet.doGet(jakarta.servlet.http.HttpServletRequest, jakarta.servlet.http.HttpServletResponse)
-