diff --git a/src/main/webapp/index.jsp b/src/main/webapp/index.jsp
index 4d4f716..6a66195 100644
--- a/src/main/webapp/index.jsp
+++ b/src/main/webapp/index.jsp
@@ -1,19 +1,36 @@
<%@ page info="index" contentType="text/html; charset=utf-8" pageEncoding="utf-8" session="false" %>
-<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
-
-
-
-
-
-
-
-
-
-
-
-
-
+<%
+ long date0 = System.currentTimeMillis();
+String token = net.sourceforge.plantuml.pstat.Stats.getInstance().getNewToken(date0);
+
+String contextRoot = request.getContextPath();
+String host = "http://" + request.getServerName() + ":" + request.getServerPort();
+String encoded = "";
+String umltext = "";
+String imgurl = "";
+String svgurl = "";
+String txturl = "";
+String mapurl = "";
+Object mapNeeded = request.getAttribute("net.sourceforge.plantuml.servlet.mapneeded");
+Object encodedAttribute = request.getAttribute("net.sourceforge.plantuml.servlet.encoded");
+if (encodedAttribute != null) {
+ encoded = encodedAttribute.toString();
+ if (!encoded.isEmpty()) {
+ imgurl = host + contextRoot + "/img/" + encoded;
+ svgurl = host + contextRoot + "/svg/" + encoded;
+ txturl = host + contextRoot + "/txt/" + encoded;
+ if (mapNeeded != null) {
+ mapurl = host + contextRoot + "/map/" + encoded;
+ }
+ }
+}
+Object decodedAttribute = request.getAttribute("net.sourceforge.plantuml.servlet.decoded");
+if (decodedAttribute != null) {
+ umltext = decodedAttribute.toString();
+}
+%>
@@ -22,58 +39,272 @@
-
-
-
+
+
+
<%-- CONTENT --%>
-
You can enter here a previously generated URL:
-
-
-
- View as SVG
- View as ASCII Art
-
- View Map Data
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ <% if ( !imgurl.isEmpty()) { %>
+
+
View as SVG
+
View as ASCII Art
+ <% if (mapNeeded != null) { %>
+
View Map Data
+ <% } //endif %>
+ <% if (!encoded.isEmpty()) { %>
+
+
+
+ <% } //endif %>
+
+
+ <% if (mapNeeded != null) { %>
+
+
+ <% } else { %>
+
+ <% } %>
+
+ <% } //endif %>
+