aboutsummaryrefslogtreecommitdiff
path: root/src/main/webapp/pages
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/webapp/pages')
-rw-r--r--src/main/webapp/pages/pokemonViewModel.jsp56
-rw-r--r--src/main/webapp/pages/userIndex.jsp19
2 files changed, 60 insertions, 15 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
diff --git a/src/main/webapp/pages/userIndex.jsp b/src/main/webapp/pages/userIndex.jsp
index 5bf5320..e54c742 100644
--- a/src/main/webapp/pages/userIndex.jsp
+++ b/src/main/webapp/pages/userIndex.jsp
@@ -44,24 +44,14 @@ Trenutno izabran pokemon:
}
else{
%>
- <table>
- <tr>
- <th>Ime</th>
- <th>Opis</th>
- <th>Hp</th>
- <th>Slika</th>
- </tr>
- <tr>
- <td><c:out value="${myMonster.name}"/></td>
- <td><c:out value="${myMonster.description}"/></td>
- <td><c:out value="${myMonster.hp}"/></td>
- <td><img style="height: 50px" src="data:image/*;base64, ${myMonster.base64Image }" /></td>
- </tr>
- </table>
+ <jsp:include page="pokemonViewModel.jsp">
+ <jsp:param value="${myMonster.id}" name="monsterId"/>
+ </jsp:include>
<%
}
%>
<br><br><br>
+<h1>Svi pokemoni</h1>
<table>
<tr>
<th>Ime</th>
@@ -93,6 +83,5 @@ Trenutno izabran pokemon:
</c:forEach>
</table>
-
</body>
</html> \ No newline at end of file