I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit e379ca6c authored by zzz's avatar zzz
Browse files

SusiDNS: Fix jsp EL syntax error with EL 3.0 (Tomcat 8) (ticket #1870)

parent 5d0b35d5
No related branches found
No related tags found
No related merge requests found
......@@ -111,6 +111,9 @@ public class AddressbookBean extends BaseBean
return entries;
}
/**
* This always returns a valid book, non-null.
*/
public String getBook()
{
if( book == null || ( !book.equalsIgnoreCase( "master" ) &&
......@@ -357,6 +360,7 @@ public class AddressbookBean extends BaseBean
return filter;
}
/****
public boolean isMaster()
{
return getBook().equalsIgnoreCase("master");
......@@ -373,6 +377,28 @@ public class AddressbookBean extends BaseBean
{
return getBook().equalsIgnoreCase("private");
}
****/
/**
* Because the following from addressbook.jsp fails parsing in the new EL:
* javax.el.ELException: Failed to parse the expression
* Can't figure out why, so just replace it with book.validBook:
* <c:if test="${book.master || book.router || book.published || book.private}">
*
* This always returns true anyway, because getBook() always
* returns a valid book.
*
* @return true
* @since 0.9.28
*/
public boolean isValidBook() {
String s = getBook().toLowerCase(Locale.US);
return s.equals("router") ||
s.equals("master") ||
s.equals("published") ||
s.equals("private");
}
public void setFilter(String filter) {
if( filter != null && ( filter.length() == 0 || filter.equalsIgnoreCase("none"))) {
filter = null;
......
......@@ -143,7 +143,7 @@ ${book.loadBookMessages}
<table class="book" cellspacing="0" cellpadding="5">
<tr class="head">
<c:if test="${book.master || book.router || book.published || book.private}">
<c:if test="${book.validBook}">
<th>&nbsp;</th>
</c:if>
......@@ -155,7 +155,7 @@ ${book.loadBookMessages}
<!-- limit iterator, or "Form too large" may result on submit, and is a huge web page if we don't -->
<c:forEach items="${book.entries}" var="addr" begin="${book.resultBegin}" end="${book.resultEnd}">
<tr class="list${book.trClass}">
<c:if test="${book.master || book.router || book.published || book.private}">
<c:if test="${book.validBook}">
<td class="checkbox"><input type="checkbox" name="checked" value="${addr.name}" title="<%=intl._t("Mark for deletion")%>"></td>
</c:if>
<td class="names"><a href="http://${addr.name}/" target="_top">${addr.displayName}</a>
......@@ -172,7 +172,7 @@ ${book.loadBookMessages}
</div>
<% if (book.getEntries().length > 0) { /* Don't show if no results. Can't figure out how to do this with c:if */ %>
<c:if test="${book.master || book.router || book.published || book.private}">
<c:if test="${book.validBook}">
<div id="buttons">
<p class="buttons">
<input class="cancel" type="reset" value="<%=intl._t("Cancel")%>" >
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment