Commit 501e79c4 authored by Matija Obreza's avatar Matija Obreza

Use <c:out for user-provided data in Genesys search

parent ba42ae3b
......@@ -176,7 +176,7 @@ public class SearchController {
}
} catch (SearchException e) {
LOG.info("Searching for: " + searchQuery + " failed with error " + e.getMessage());
LOG.error(e.getMessage(), e);
LOG.error(e.getMessage());
model.addAttribute("error", e);
}
}
......
......@@ -26,7 +26,8 @@
<div class="results"><spring:message code="paged.totalElements" arguments="${pagedData.totalElements}" /></div>
<div class="pagination">
<spring:message code="paged.pageOfPages" arguments="${pagedData.number+1},${pagedData.totalPages}" />
<a class="${pagedData.number eq 0 ? 'disabled' :''}" href="?q=${q}&amp;page=${pagedData.number eq 0 ? 1 : pagedData.number}"><spring:message code="pagination.previous-page" /></a> <a href="?q=${q}&amp;page=${pagedData.number + 2}"><spring:message code="pagination.next-page" /></a>
<c:url value="" var="baseLink"><c:param name="q" value="${q}" /></c:url>
<a class="${pagedData.number eq 0 ? 'disabled' :''}" href="${baseLink}&amp;page=${pagedData.number eq 0 ? 1 : pagedData.number}"><spring:message code="pagination.previous-page" /></a> <a href="${baseLink}&amp;page=${pagedData.number + 2}"><spring:message code="pagination.next-page" /></a>
</div>
</div>
</div>
......
......@@ -18,9 +18,10 @@
<input type="hidden" name="q" value="<c:out value="${q}" />" />
<div class="pagination">
<spring:message code="paged.pageOfPages" arguments="${pagedData.number+1},${pagedData.totalPages}" />
<a class="${pagedData.number eq 0 ? 'disabled' :''}" href="?q=<c:out value="${q}" />&amp;page=${pagedData.number eq 0 ? 1 : pagedData.number}&amp;section=${section}"><spring:message code="pagination.previous-page" /></a>
<c:url value="" var="baseLink"><c:param name="q" value="${q}" /><c:param name="section" value="${section}" /></c:url>
<a class="${pagedData.number eq 0 ? 'disabled' :''}" href="${baseLink}&amp;page=${pagedData.number eq 0 ? 1 : pagedData.number}"><spring:message code="pagination.previous-page" /></a>
<input class="form-control" style="display: inline; max-width: 5em; text-align: center" type="text" name="page" placeholder="${pagedData.number + 1}" />
<a href="?q=<c:out value="${q}" />&amp;page=${pagedData.number + 2}&amp;section=${section}"><spring:message code="pagination.next-page" /></a>
<a href="${baseLink}&amp;page=${pagedData.number + 2}"><spring:message code="pagination.next-page" /></a>
</div>
</form>
</div>
......@@ -52,7 +53,7 @@
<ul class="nav nav-tabs">
<c:forTokens items="${sectionList}" delims="," var="sect">
<li class=${sect eq section ? "active" : ""}>
<a href="<c:url value="/acn/search2" />?q=${q}&amp;section=${sect}"><spring:message code="search.section.${sect}" /></a>
<a href="<c:url value="/acn/search2"><c:param name="q" value="${q}" /><c:param name="section" value="${sect}" /></c:url>"><spring:message code="search.section.${sect}" /></a>
</li>
</c:forTokens>
</ul>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment