2011-03-10 14:54:36 +00:00
|
|
|
<%@ page info="index" contentType="text/html; charset=utf-8" pageEncoding="utf-8" session="false" %>
|
2011-02-16 08:18:23 +00:00
|
|
|
|
|
|
|
<%
|
|
|
|
String contextRoot = request.getContextPath();
|
|
|
|
String host = "http://" + request.getServerName() + ":" + request.getServerPort();
|
|
|
|
String encoded = "";
|
|
|
|
String umltext = "";
|
|
|
|
String imgurl = "";
|
2011-04-21 17:52:50 +00:00
|
|
|
String svgurl = "";
|
|
|
|
String txturl = "";
|
2011-02-16 08:18:23 +00:00
|
|
|
Object encodedAttribute = request.getAttribute("net.sourceforge.plantuml.servlet.encoded");
|
|
|
|
if (encodedAttribute != null) {
|
|
|
|
encoded = encodedAttribute.toString();
|
|
|
|
if (!encoded.isEmpty()) {
|
|
|
|
imgurl = host + contextRoot + "/img/" + encoded;
|
2011-04-21 17:52:50 +00:00
|
|
|
svgurl = host + contextRoot + "/svg/" + encoded;
|
|
|
|
txturl = host + contextRoot + "/txt/" + encoded;
|
2011-02-16 08:18:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
Object decodedAttribute = request.getAttribute("net.sourceforge.plantuml.servlet.decoded");
|
2011-03-09 15:55:57 +00:00
|
|
|
if (decodedAttribute != null) {
|
2011-02-16 08:18:23 +00:00
|
|
|
umltext = decodedAttribute.toString();
|
|
|
|
}
|
|
|
|
%>
|
|
|
|
|
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
|
|
<head>
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
|
|
<meta http-equiv="expires" content="0" />
|
|
|
|
<meta http-equiv="pragma" content="no-cache" />
|
|
|
|
<meta http-equiv="cache-control" content="no-cache, must-revalidate" />
|
|
|
|
<link rel="stylesheet" href="<%=contextRoot %>/plantuml.css" type="text/css"/>
|
|
|
|
<link rel="icon" href="<%=contextRoot %>/favicon.ico" type="image/x-icon"/>
|
|
|
|
<link rel="shortcut icon" href="<%=contextRoot %>/favicon.ico" type="image/x-icon"/>
|
|
|
|
<title>PlantUMLServer</title>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div id="header">
|
|
|
|
<%-- PAGE TITLE --%>
|
2011-03-31 14:20:15 +00:00
|
|
|
<h1>PlantUML Server</h1>
|
2011-02-16 08:18:23 +00:00
|
|
|
<p>This application provides a servlet which serves images created by <a href="http://plantuml.sourceforge.net">PlantUML</a>.</p>
|
|
|
|
</div>
|
|
|
|
<div id="content">
|
|
|
|
<%-- CONTENT --%>
|
2011-02-20 16:05:48 +00:00
|
|
|
<form method="post" accept-charset="UTF-8" action="<%=contextRoot %>/form">
|
2011-02-16 08:18:23 +00:00
|
|
|
<p>
|
|
|
|
<textarea name="text" cols="120" rows="10"><%=umltext %></textarea>
|
|
|
|
<br/>
|
|
|
|
<input type="submit" />
|
|
|
|
</p>
|
|
|
|
</form>
|
|
|
|
<hr/>
|
|
|
|
You can enter here a previously generated URL:
|
|
|
|
<form method="post" action="<%=contextRoot %>/form">
|
|
|
|
<p>
|
|
|
|
<input name="url" type="text" size="150" value="<%=imgurl %>" />
|
|
|
|
<br/>
|
|
|
|
<input type="submit"/>
|
|
|
|
</p>
|
|
|
|
</form>
|
|
|
|
<% if ( !imgurl.isEmpty()) { %>
|
|
|
|
<hr/>
|
2011-04-26 12:47:47 +00:00
|
|
|
<a href="<%=svgurl%>">View as SVG</a>
|
|
|
|
<a href="<%=txturl%>">View as ASCII Art</a>
|
2011-03-31 14:20:15 +00:00
|
|
|
<p id="diagram">
|
|
|
|
<img src="<%=imgurl %>" alt="PlantUML diagram"/>
|
2011-02-16 08:18:23 +00:00
|
|
|
</p>
|
|
|
|
<% } //endif %>
|
|
|
|
</div>
|
2011-03-18 15:35:45 +00:00
|
|
|
<!-- This comment is used by the TestProxy class
|
|
|
|
@startuml
|
|
|
|
Bob -> Alice : hello
|
|
|
|
@enduml
|
|
|
|
-->
|
2011-03-31 14:20:15 +00:00
|
|
|
<%-- FOOTER --%>
|
|
|
|
<%@ include file="footer.jspf" %>
|
2011-02-16 08:18:23 +00:00
|
|
|
</body>
|
|
|
|
</html>
|