Commit 280d16e0 authored by Matija Obreza's avatar Matija Obreza
Browse files

More of <c:url

parent b6a046ab
...@@ -110,7 +110,7 @@ public class LocaleURLFilter implements Filter { ...@@ -110,7 +110,7 @@ public class LocaleURLFilter implements Filter {
if (!localeAllowed) { if (!localeAllowed) {
LOG.warn("Locale not allowed. Temporary redirect to default locale."); LOG.warn("Locale not allowed. Temporary redirect to default locale.");
httpResponse.sendRedirect(remainingUrl); httpResponse.sendRedirect(getInternalUrl(remainingUrl, httpRequest.getQueryString()));
return; return;
} }
} }
...@@ -155,7 +155,9 @@ public class LocaleURLFilter implements Filter { ...@@ -155,7 +155,9 @@ public class LocaleURLFilter implements Filter {
LOG.debug("No match on url " + url); LOG.debug("No match on url " + url);
} }
httpRequest.setAttribute(REQUEST_INTERNAL_URL, getInternalUrl(url, httpRequest.getQueryString())); httpRequest.setAttribute(REQUEST_INTERNAL_URL, getInternalUrl(url, httpRequest.getQueryString()));
filterChain.doFilter(servletRequest, servletResponse); LocaleWrappedServletResponse localeResponse = new LocaleWrappedServletResponse(httpResponse, localeUrlMatcher, null,
defaultLocale.toLanguageTag());
filterChain.doFilter(servletRequest, localeResponse);
} }
} }
......
...@@ -45,7 +45,7 @@ public class LocaleWrappedServletResponse extends HttpServletResponseWrapper { ...@@ -45,7 +45,7 @@ public class LocaleWrappedServletResponse extends HttpServletResponseWrapper {
public String encodeURL(String url) { public String encodeURL(String url) {
if (isExcluded(url)) { if (isExcluded(url)) {
if (url.startsWith(defaultLanguagePrefix)) { if (url.startsWith(defaultLanguagePrefix)) {
return super.encodeURL(url.substring(3)); return super.encodeURL(url.substring(defaultLanguagePrefix.length() - 1));
} }
return super.encodeURL(url); return super.encodeURL(url);
} else { } else {
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<div style="display: none" id="session_expired_popup" title="<spring:message code="session.expiry-warning-title" />" > <div style="display: none" id="session_expired_popup" title="<spring:message code="session.expiry-warning-title" />" >
<div style="margin-bottom: 1em;"><spring:message code="session.expiry-warning" /></div> <div style="margin-bottom: 1em;"><spring:message code="session.expiry-warning" /></div>
<a class="btn btn-primary" href="<c:out value="/" />"><spring:message code="session.expiry-extend" /></a> <a class="btn btn-primary" href="<c:url value="/" />"><spring:message code="session.expiry-extend" /></a>
</div> </div>
<!-- Bootstrap core JavaScript <!-- Bootstrap core JavaScript
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><spring:message code="page.login" /></a> <a href="#" class="dropdown-toggle" data-toggle="dropdown"><spring:message code="page.login" /></a>
<ul class="dropdown-menu pull-left"> <ul class="dropdown-menu pull-left">
<li> <li>
<form role="form" method="post" action="/login-attempt"> <form role="form" method="post" action="<c:url value="/login-attempt" />">
<div class="form-group"> <div class="form-group">
<label for="username"><spring:message code="login.username"/>:</label> <label for="username"><spring:message code="login.username"/>:</label>
<input type="email" class="form-control" id="username" name="j_username" placeholder="<spring:message code="login.username"/>" /> <input type="email" class="form-control" id="username" name="j_username" placeholder="<spring:message code="login.username"/>" />
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><spring:message code="page.login" /></a> <a href="#" class="dropdown-toggle" data-toggle="dropdown"><spring:message code="page.login" /></a>
<ul class="dropdown-menu pull-left"> <ul class="dropdown-menu pull-left">
<li> <li>
<form role="form" method="post" action="/login-attempt"> <form role="form" method="post" action="<c:url value="/login-attempt" />">
<div class="form-group"> <div class="form-group">
<label for="username"><spring:message code="login.username"/>:</label> <label for="username"><spring:message code="login.username"/>:</label>
<input type="email" class="form-control" id="username" name="j_username" placeholder="<spring:message code="login.username"/>" /> <input type="email" class="form-control" id="username" name="j_username" placeholder="<spring:message code="login.username"/>" />
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
<div class="ui-front"> <div class="ui-front">
<div class="form-group input-group"> <div class="form-group input-group">
<span class="input-group-btn"> <span class="input-group-btn">
<input id="${normalizedKey}_input" class="span2 form-control autocomplete-filter string-type" x-source="${filter.autocompleteUrl}" placeholder="<spring:message code="filter.autocomplete-placeholder" />" type="text"/> <input id="${normalizedKey}_input" class="span2 form-control autocomplete-filter string-type" x-source="<c:url value="${filter.autocompleteUrl}" />" placeholder="<spring:message code="filter.autocomplete-placeholder" />" type="text"/>
<button class="btn notimportant filter-auto" norm-key="<c:out value="${normalizedKey}" />" i-key="<c:out value="${filter.key}" />">+</button> <button class="btn notimportant filter-auto" norm-key="<c:out value="${normalizedKey}" />" i-key="<c:out value="${filter.key}" />">+</button>
</span> </span>
</div> </div>
......
...@@ -131,7 +131,7 @@ ...@@ -131,7 +131,7 @@
<div class="ui-front"> <div class="ui-front">
<div class="form-group input-group"> <div class="form-group input-group">
<span class="input-group-btn"> <span class="input-group-btn">
<input id="<c:out value="${normalizedKey}" />_input" class="span2 form-control autocomplete-filter string-type" x-source="${filter.autocompleteUrl}" placeholder="<spring:message code="filter.autocomplete-placeholder" />" type="text"/> <input id="<c:out value="${normalizedKey}" />_input" class="span2 form-control autocomplete-filter string-type" x-source="<c:url value="${filter.autocompleteUrl}" />" placeholder="<spring:message code="filter.autocomplete-placeholder" />" type="text"/>
<button class="btn notimportant filter-auto" norm-key="<c:out value="${normalizedKey}" />" i-key="<c:out value="${filter.key}" />">+</button> <button class="btn notimportant filter-auto" norm-key="<c:out value="${normalizedKey}" />" i-key="<c:out value="${filter.key}" />">+</button>
</span> </span>
</div> </div>
...@@ -299,7 +299,7 @@ ...@@ -299,7 +299,7 @@
$("#menu2").on("click", function () { $("#menu2").on("click", function () {
$.ajax("/modal", { $.ajax("<c:url value="/modal" />", {
type: 'GET', type: 'GET',
data: "shortName=" + jsonData.crops, data: "shortName=" + jsonData.crops,
success: function (data) { success: function (data) {
...@@ -377,13 +377,13 @@ ...@@ -377,13 +377,13 @@
}); });
$("body").on("click", ".apply", function () { $("body").on("click", ".apply", function () {
GenesysFilterUtil.submitJson('/explore-es', jsonData); GenesysFilterUtil.submitJson('<c:url value="/explore-es" />', jsonData);
}); });
$("body").on("click", ".remove-filter", function () { $("body").on("click", ".remove-filter", function () {
var key = $(this).parents(".filter-block").attr("i-key"); var key = $(this).parents(".filter-block").attr("i-key");
delete jsonData[key]; delete jsonData[key];
GenesysFilterUtil.submitJson('/explore-es', jsonData); GenesysFilterUtil.submitJson('<c:url value="/explore-es" />', jsonData);
}); });
$("body").on("click", ".edit-fil", function () { $("body").on("click", ".edit-fil", function () {
...@@ -407,7 +407,7 @@ ...@@ -407,7 +407,7 @@
GenesysFilterUtil.removeValue(value, key, jsonData); GenesysFilterUtil.removeValue(value, key, jsonData);
if (! $(this).parents(".filter-block").hasClass("filter-edit")) { if (! $(this).parents(".filter-block").hasClass("filter-edit")) {
GenesysFilterUtil.submitJson('/explore-es', jsonData); GenesysFilterUtil.submitJson('<c:url value="/explore-es" />', jsonData);
} }
$(this).remove(); $(this).remove();
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
</div> </div>
<div class="col-sm-12 col-md-6" style="text-align: right; padding-top: 12px"> <div class="col-sm-12 col-md-6" style="text-align: right; padding-top: 12px">
<c:if test="${pagedData.totalElements le 100000}"> <c:if test="${pagedData.totalElements le 100000}">
<form style="display: inline-block" method="post" action="/explore/dwca"> <form style="display: inline-block" method="post" action="<c:url value="/explore/dwca" />">
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/> <input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
<input type="hidden" name="filter" value="<c:out value="${jsonFilter}" />" /> <input type="hidden" name="filter" value="<c:out value="${jsonFilter}" />" />
<button class="btn btn-default" type="submit"><spring:message code="filter.download-dwca" /></button> <button class="btn btn-default" type="submit"><spring:message code="filter.download-dwca" /></button>
...@@ -132,7 +132,7 @@ ...@@ -132,7 +132,7 @@
<div class="ui-front"> <div class="ui-front">
<div class="form-group input-group"> <div class="form-group input-group">
<span class="input-group-btn"> <span class="input-group-btn">
<input id="<c:out value="${normalizedKey}" />_input" class="span2 form-control autocomplete-filter string-type" x-source="${filter.autocompleteUrl}" placeholder="<spring:message code="filter.autocomplete-placeholder" />" type="text"/> <input id="<c:out value="${normalizedKey}" />_input" class="span2 form-control autocomplete-filter string-type" x-source="<c:url value="${filter.autocompleteUrl}" />" placeholder="<spring:message code="filter.autocomplete-placeholder" />" type="text"/>
<button class="btn notimportant filter-auto" norm-key="<c:out value="${normalizedKey}" />" i-key="<c:out value="${filter.key}" />">+</button> <button class="btn notimportant filter-auto" norm-key="<c:out value="${normalizedKey}" />" i-key="<c:out value="${filter.key}" />">+</button>
</span> </span>
</div> </div>
...@@ -300,7 +300,7 @@ ...@@ -300,7 +300,7 @@
$("#menu2").on("click", function () { $("#menu2").on("click", function () {
$.ajax("/modal", { $.ajax("<c:url value="/modal" />", {
type: 'GET', type: 'GET',
data: "shortName=" + jsonData.crops, data: "shortName=" + jsonData.crops,
success: function (data) { success: function (data) {
...@@ -378,13 +378,13 @@ ...@@ -378,13 +378,13 @@
}); });
$("body").on("click", ".apply", function () { $("body").on("click", ".apply", function () {
GenesysFilterUtil.submitJson('/explore', jsonData); GenesysFilterUtil.submitJson('<c:url value="/explore" />', jsonData);
}); });
$("body").on("click", ".remove-filter", function () { $("body").on("click", ".remove-filter", function () {
var key = $(this).parents(".filter-block").attr("i-key"); var key = $(this).parents(".filter-block").attr("i-key");
delete jsonData[key]; delete jsonData[key];
GenesysFilterUtil.submitJson('/explore', jsonData); GenesysFilterUtil.submitJson('<c:url value="/explore" />', jsonData);
}); });
$("body").on("click", ".edit-fil", function () { $("body").on("click", ".edit-fil", function () {
...@@ -408,7 +408,7 @@ ...@@ -408,7 +408,7 @@
GenesysFilterUtil.removeValue(value, key, jsonData); GenesysFilterUtil.removeValue(value, key, jsonData);
if (! $(this).parents(".filter-block").hasClass("filter-edit")) { if (! $(this).parents(".filter-block").hasClass("filter-edit")) {
GenesysFilterUtil.submitJson('/explore', jsonData); GenesysFilterUtil.submitJson('<c:url value="/explore" />', jsonData);
} }
$(this).remove(); $(this).remove();
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<div class="nav-header"> <div class="nav-header">
<div class="pull-right"> <div class="pull-right">
<a class="btn btn-default" href="<c:url value="/explore" />" id="selectArea"><spring:message code="view.accessions" /></a> <a class="btn btn-default" href="<c:url value="/explore" />" id="selectArea"><spring:message code="view.accessions" /></a>
<form style="display: inline-block" method="post" action="/explore/kml"> <form style="display: inline-block" method="post" action="<c:url value="/explore/kml" />">
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/> <input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
<input type="hidden" name="filter" value="<c:out value="${jsonFilter}" />" /> <input type="hidden" name="filter" value="<c:out value="${jsonFilter}" />" />
<button class="btn btn-default" type="submit"><spring:message code="download.kml" /></button> <button class="btn btn-default" type="submit"><spring:message code="download.kml" /></button>
......
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
var object = { "oid": ${aclObjectIdentity.objectIdIdentity},"clazz":"${aclObjectIdentity.aclClass.aclClass}","uuid":$("#permissionAdder input[type=text]")[0].value,"principal":true, var object = { "oid": ${aclObjectIdentity.objectIdIdentity},"clazz":"${aclObjectIdentity.aclClass.aclClass}","uuid":$("#permissionAdder input[type=text]")[0].value,"principal":true,
"create":create,"read":read,"write":write,"delete":remove,"manage":manage}; "create":create,"read":read,"write":write,"delete":remove,"manage":manage};
//debugger; //debugger;
$.ajax("/json/v0/permission/add", { $.ajax("<c:url value="/json/v0/permission/add" />", {
type : 'POST', type : 'POST',
dataType : 'json', dataType : 'json',
contentType: 'application/json; charset=utf-8', contentType: 'application/json; charset=utf-8',
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<div class="alert alert-danger"><spring:message code="login.invalid-token"/></div> <div class="alert alert-danger"><spring:message code="login.invalid-token"/></div>
</c:if> </c:if>
<form role="form" method="POST" action="/login-attempt" class="form-horizontal"> <form role="form" method="POST" action="<c:url value="/login-attempt" />" class="form-horizontal">
<div class="form-group"> <div class="form-group">
<label for="j_username" class="col-lg-2 control-label"><spring:message code="login.username"/></label> <label for="j_username" class="col-lg-2 control-label"><spring:message code="login.username"/></label>
<div class="col-lg-3"> <div class="col-lg-3">
......
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
<div> <div>
<form class="form-horizontal" method="post" action="/data/view/${metadata.id}/dwca"> <form class="form-horizontal" method="post" action="<c:url value="/data/view/${metadata.id}/dwca" />">
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/> <input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
<div class="row" style="margin-top: 2em;"> <div class="row" style="margin-top: 2em;">
<div class="col-sm-4"> <div class="col-sm-4">
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<div class="main-col-header clearfix"> <div class="main-col-header clearfix">
<div class="nav-header"> <div class="nav-header">
<form class="pull-right form-horizontal" method="post" action="/sel/dwca"> <form class="pull-right form-horizontal" method="post" action="<c:url value="/sel/dwca" />">
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/> <input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
<div class="row" style="margin-top: 2em;"> <div class="row" style="margin-top: 2em;">
<div class="col-sm-4"> <div class="col-sm-4">
......
...@@ -193,8 +193,8 @@ ...@@ -193,8 +193,8 @@
</script> </script>
<script> <script>
jQuery(document).ready(function () { jQuery(document).ready(function () {
GenesysChart.chart("#chartStatsByGenus", "/wiews/${faoInstitute.code}/stat-genus", null, null, function(genus) { window.location=window.location.pathname + "/t/" + genus; }); GenesysChart.chart("#chartStatsByGenus", "<c:url value="/wiews/${faoInstitute.code}/stat-genus" />", null, null, function(genus) { window.location=window.location.pathname + "/t/" + genus; });
GenesysChart.chart("#chartStatsBySpecies", "/wiews/${faoInstitute.code}/stat-species", null, function(taxonomy) { return taxonomy.taxonName; }, function(taxonomy) { window.location=window.location.pathname + "/t/" + taxonomy.genus + "/" + taxonomy.species; }); GenesysChart.chart("#chartStatsBySpecies", "<c:url value="/wiews/${faoInstitute.code}/stat-species" />", null, function(taxonomy) { return taxonomy.taxonName; }, function(taxonomy) { window.location=window.location.pathname + "/t/" + taxonomy.genus + "/" + taxonomy.species; });
}); });
</script> </script>
</content> </content>
......
...@@ -459,7 +459,7 @@ GenesysFilterUtil = { ...@@ -459,7 +459,7 @@ GenesysFilterUtil = {
return; return;
} }
$.ajax("/additional-filter", { $.ajax("/" + document.documentElement.lang + "/additional-filter", {
type: 'GET', type: 'GET',
data: "filter=" + filter, data: "filter=" + filter,
...@@ -484,7 +484,7 @@ GenesysFilterUtil = { ...@@ -484,7 +484,7 @@ GenesysFilterUtil = {
jQuery(document).ready(function() { jQuery(document).ready(function() {
$("body").on("click", ".get_widget", function () { $("body").on("click", ".get_widget", function () {
var clientId = $(this).val(); var clientId = $(this).val();
$.ajax("/get_widget", { $.ajax("/" + document.documentElement.lang + "/get_widget", {
type: 'GET', type: 'GET',
data: 'clientId=' + clientId, data: 'clientId=' + clientId,
success: function (data) { success: function (data) {
......
Supports Markdown
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