-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.jsp
66 lines (41 loc) · 1.17 KB
/
index.jsp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec"
uri="http://www.springframework.org/security/tags"%>
<table class="offerstable" cellspacing="10">
<tr>
<td><b><u>Name</u></b></td>
<td><b><u>Email</u></b></td>
<td><b><u>Offer</u></b></td>
</tr>
<c:forEach var="offer" items="${offers}">
<tr>
<td><c:out value="${offer.user.name}"></c:out></td>
<td>
<c:choose>
<c:when test="${user!=offer.username}"> <a href="<c:url value='/message?uid=${offer.username}'></c:url>">Contact</a> </c:when>
<c:otherwise><c:out value="${offer.user.email}"></c:out></c:otherwise>
</c:choose>
</td>
<td><c:out value="${offer.text}"></c:out></td>
</tr>
</c:forEach>
</table>
<br />
<script type="text/javascript">
function updateMessageLink(data)
{
$("#numberMessages").text(data.number);
}
function onLoad()
{
updatePage();
window.setInterval(updatePage, 5000);
}
function updatePage()
{
$.getJSON("<c:url value="/getMessages"/>", updateMessageLink);
}
$(document).ready(onLoad);
</script>