source: ComponentRegistry/branches/ComponentRegistry-2.0/ComponentRegistry/src/main/webapp/compRegConfig.jsp @ 6890

Last change on this file since 6890 was 6890, checked in by Twan Goosen, 9 years ago

static getApplicationBaseURI method, now called from JSP configuration template. Fixes #844

File size: 856 bytes
Line 
1<%-- Configuration hosted next to the front end index page, from which it is loaded --%>
2<%@ page import="java.net.URI" %>
3<%@ page import="clarin.cmdi.componentregistry.rest.ComponentRegistryRestService" %>
4<%
5    final String loglevelParam = request.getParameter("loglevel");
6    final String loglevel;
7    if(loglevelParam != null) {
8        loglevel = loglevelParam;
9    } else {
10        loglevel = "info" ;
11    }
12   
13    final String appUrl = ComponentRegistryRestService.getApplicationBaseURI(getServletContext(), request);
14%>
15{
16  "loglevel": "<%= loglevel %>",
17  "cors": false,
18  "REST": {
19    "url": "<%= appUrl %>"
20  },
21  "backEndVersion": "${project.version}",
22  "frontEndVersion": "${frontEndVersion}",
23  "deploy": {
24    "path": "<%= 
25                URI.create(appUrl).getPath() //at same URL as app, so simply take path
26            %>"
27  }
28}
Note: See TracBrowser for help on using the repository browser.