aboutsummaryrefslogtreecommitdiff
path: root/src/main/webapp/pages/pokemonViewModel.jsp
diff options
context:
space:
mode:
authorOgnjen Cirkovic <ciraboxkg@gmail.com>2022-12-22 02:57:23 +0100
committerOgnjen Cirkovic <ciraboxkg@gmail.com>2022-12-22 02:57:23 +0100
commitd179cfa6ee128d67a4e66377ac0321bc78c6613f (patch)
treea354ce842e6302e6faced29e10e27a87ba605514 /src/main/webapp/pages/pokemonViewModel.jsp
parentbf0edd9a699e5b6374468cc8d5c36b4e22842e24 (diff)
Napravljen viewModel za prikaz pokemona za abilitijima. Prikaz na stranici korisnika.
Diffstat (limited to 'src/main/webapp/pages/pokemonViewModel.jsp')
-rw-r--r--src/main/webapp/pages/pokemonViewModel.jsp56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/main/webapp/pages/pokemonViewModel.jsp b/src/main/webapp/pages/pokemonViewModel.jsp
new file mode 100644
index 0000000..ba0068b
--- /dev/null
+++ b/src/main/webapp/pages/pokemonViewModel.jsp
@@ -0,0 +1,56 @@
+<%@page import="models.MonsterViewModel"%>
+<%@page import="models.CONSTS"%>
+<%@page import="java.rmi.Naming"%>
+<%@page import="pokemon.IService"%>
+<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
+ pageEncoding="ISO-8859-1"%>
+ <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="ISO-8859-1">
+<title>Insert title here</title>
+</head>
+<body>
+<%
+ long monsterId=Long.parseLong(request.getParameter("monsterId"));
+ IService service=(IService)Naming.lookup(CONSTS.rmiUrl);
+ MonsterViewModel monster=service.getMonsterViewModel(monsterId);
+ request.setAttribute("monster", monster);
+
+
+%>
+<table>
+ <tr>
+ <th>Ime</th>
+ <th>Opis</th>
+ <th>Hp</th>
+ <th>Slika</th>
+ </tr>
+ <tr>
+ <td><c:out value="${monster.name}"/></td>
+ <td><c:out value="${monster.description}"/></td>
+ <td><c:out value="${monster.hp}"/></td>
+ <td><img style="height: 50px" src="data:image/*;base64, ${monster.base64Image }" /></td>
+ </tr>
+</table>
+<table>
+ <tr>
+ <th>Ime</th>
+ <th>Opis</th>
+ <th>Type</th>
+ <th>Snaga</th>
+ </tr>
+ <c:forEach items="${monster.abilities}" var="item">
+ <tr>
+ <td><c:out value="${item.name}"/></td>
+ <td><c:out value="${item.description}"/></td>
+ <td><c:out value="${item.type}"/></td>
+ <td><c:out value="${item.power}"/></td>
+ </tr>
+ </c:forEach>
+
+</table>
+
+</body>
+</html> \ No newline at end of file