Skip to content

Commit fe73e47

Browse files
committed
This is a JSP server and we can plug in the about parts immediately,
so there's no distracting jump.
1 parent 8bacd3c commit fe73e47

1 file changed

Lines changed: 25 additions & 2 deletions

File tree

‎HapiServer/web/hapi/index.jsp‎

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,34 @@
1-
1+
<%@page import="org.hapiserver.HapiServerSupport"%>
2+
<%@page import="org.codehaus.jettison.json.JSONObject"%>
3+
<%@page import="org.hapiserver.Initialize"%>
24
<%@page import="org.hapiserver.Util"%>
5+
<%
6+
String HAPI_HOME = Initialize.getHapiHome(getServletContext());
7+
8+
String uri = request.getRequestURI();
9+
10+
boolean withinHapi = uri.endsWith("/hapi/"); // if true, then references must be relative
11+
String h = "hapi/";
12+
if (withinHapi) {
13+
h = "";
14+
}
15+
16+
JSONObject landingConfig = HapiServerSupport.getLandingConfig(HAPI_HOME);
17+
JSONObject about = HapiServerSupport.getAbout(HAPI_HOME);
18+
%>
19+
320
<!doctype html>
421
<html lang="en">
522
<head>
623
<meta charset="utf-8">
724
<meta name="viewport" content="width=device-width,initial-scale=1">
8-
<title>HAPI Server</title>
25+
<title><%= Util.escapeHtml(about.optString("title", "Basic HAPI Server"))%></title>
26+
<%
27+
if (landingConfig.has("style")) {
28+
String styleUrl = landingConfig.getString("style");
29+
out.println("<link rel=\"stylesheet\" href=\"" + styleUrl + "\">");
30+
}
31+
%>
932
<style>
1033
body{
1134
font:15px system-ui,sans-serif;

0 commit comments

Comments
 (0)