ETSF20-Tomcat/app/bin/main/webapp/jsp/example.jsp

17 lines
460 B
Text
Raw Normal View History

2024-02-08 11:39:34 +01:00
<%@ page import="model.HelloJspViewModel" %>
<html>
<body>
<h2>Hello Jsp, simple data from Servlet: <%=request.getAttribute("simple")%></h2>
<ol>
<%
HelloJspViewModel model = (HelloJspViewModel)request.getAttribute("complex");
for(int el : model.getData()) { %>
<li>
<%=el%>
<% out.print(":" + el); // or as ordinary java code %>
</li>
<% } %>
</ol>
</body>
</html>