Java mit JSTL anwenden

  • Beitrags-Autor:
  • Beitrags-Kategorie:JavaEE
<%@ page import="java.util.Properties" %>
<%@ page import="net.btmx.mboee.AppUtil" %>
<% Properties props = AppUtil.lookForProperties(); %>
<c:set var="propsVal"><%= props.get("props.key") %></c:set>
<c:forEach var = "x" items = "${result.rows}" varStatus="loop">
<%
    java.util.TreeMap x = (java.util.TreeMap) pageContext.getAttribute("x");
    Double support = (Double) x.get("name");
%>
</c:forEach>
<%@ page import="org.apache.catalina.realm.GenericPrincipal" %>
<jsp:scriptlet>
    GenericPrincipal principal = (GenericPrincipal) request.getUserPrincipal();
    String loginName = principal.getName();
    pageContext.setAttribute("loginName", loginName);
    String[] loginRoles = principal.getRoles();
    pageContext.setAttribute("loginRoles", loginRoles);
</jsp:scriptlet>
<c:forEach items="${loginRoles}" var="x">
    <c:out value="${x}"/>
</c:forEach>