org.jboss.test.web.servlets
Class UserInRoleServlet
java.lang.Object
HttpServlet
org.jboss.test.web.servlets.UserInRoleServlet
- public class UserInRoleServlet
- extends HttpServlet
A servlet that calls isUserInRole for every role name defined in the
expectedUserRoles init parameter and validates that each role is assigned
to the user. Any role in the expectedUserRoles for which isUserInRole is
false is added to the X-ExpectedUserRoles-Errors reply header. If the user
has every role from the expectedUserRoles list, the X-ExpectedUserRoles-Errors
header will not be in the reply.
This servlet also calls isUserInRole for every role name defined in the
unexpectedUserRoles init parameter and validates that each role is NOT
assigned to the user. Any role in the unexpectedUserRoles for which
isUserInRole is true is added to the X-UnexpectedUserRoles-Errors reply
header. If the user has no roles from the unexpectedUserRoles list, the
X-UnexpectedUserRoles-Errors header will not be in the reply.
- See Also:
- Serialized Form
Method Summary |
protected void |
doGet(HttpServletRequest request,
HttpServletResponse response)
|
protected void |
doPost(HttpServletRequest request,
HttpServletResponse response)
|
void |
init(ServletConfig config)
|
protected void |
processRequest(HttpServletRequest request,
HttpServletResponse response)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UserInRoleServlet
public UserInRoleServlet()
init
public void init(ServletConfig config)
throws ServletException
- Throws:
ServletException
processRequest
protected void processRequest(HttpServletRequest request,
HttpServletResponse response)
throws ServletException,
java.io.IOException
- Throws:
ServletException
java.io.IOException
doGet
protected void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException,
java.io.IOException
- Throws:
ServletException
java.io.IOException
doPost
protected void doPost(HttpServletRequest request,
HttpServletResponse response)
throws ServletException,
java.io.IOException
- Throws:
ServletException
java.io.IOException