Commit bd16738e authored by Matija Obreza's avatar Matija Obreza
Browse files

Resolved #13 DwCA download uses POST method

parent d38ed06b
......@@ -40,6 +40,7 @@ import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
@Controller
......@@ -196,7 +197,7 @@ public class WiewsController extends BaseController {
return "/accession/data";
}
@RequestMapping("/{wiewsCode}/dwca")
@RequestMapping(value="/{wiewsCode}/dwca", method=RequestMethod.POST)
public void viewData(ModelMap model, @PathVariable(value = "wiewsCode") String wiewsCode, HttpServletResponse response) throws IOException {
_logger.debug("Viewing country " + wiewsCode);
FaoInstitute faoInstitute = instituteService.getInstitute(wiewsCode);
......
......@@ -140,11 +140,14 @@
</div>
<form class="form-horizontal" method="post" action="/wiews/${faoInstitute.code.toLowerCase()}/dwca">
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
<div class="row" style="margin-top: 2em;">
<div class="col-sm-4">
<a href="<c:url value="/wiews/${faoInstitute.code.toLowerCase()}/dwca" />"><spring:message code="metadata.download-dwca" /></a>
<button class="btn btn-primary" type="submit"><spring:message code="metadata.download-dwca" /></button>
</div>
</div>
</form>
<content tag="javascript">
<c:if test="${faoInstitute.latitude ne null}">
......
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