Skip to content

Commit

Permalink
JSTL cartable fix4
Browse files Browse the repository at this point in the history
  • Loading branch information
oskopek committed Apr 15, 2014
1 parent eae9a9b commit 5628542
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ public class CarTableServlet extends HttpServlet {
@EJB
private EntryBean bean;

private static final String adminRole = "admin";

/**
* @see CarTableServlet
* @param request the HttpServletRequest
Expand Down Expand Up @@ -106,6 +108,10 @@ public int compare(FileEntry o1, FileEntry o2) {
}

request.setAttribute("wrtmList", wrtmList);

boolean isAdmin = request.isUserInRole(adminRole);
request.setAttribute("isAdmin", Boolean.valueOf(isAdmin));

RequestDispatcher rd = getServletContext().getRequestDispatcher("/app/cartable.jsp");
rd.forward(request, response);
}
Expand Down
1 change: 0 additions & 1 deletion carcv-webapp/src/main/webapp/app/cartable.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
</style>
</head>
<body>
<c:set var = "isAdmin" value = "${pageContext.request.isUserInRole('admin')}" />
<c:out value = "IsAdmin: ${isAdmin ? 'true' : 'false'}" />
<table style="border: 1px solid #C0C0C0;">
<tr>
Expand Down

0 comments on commit 5628542

Please sign in to comment.