I am using BaseX 9.1.1 inside a Tomcat server trying to build a webapp using RESTXQ.
I have studied the DBA xqm files, and see that there is static content delivered to the generated login page, located in dba/static folder.
When I try to replicate this in my app, I get 404 errors saying the resource can not be found in the Developer Tools of Opera.
Below is my .xqm file. The resources in question are in bold and underlined. What am I doing wrong?
(:
Produces a simple HTML form for entering origin and destination to produce a path
:)
declare
%output:method("html")
%rest:path("/rail/a2b")
function scheduleGui:welcome() {
<html>
<head>
<script type="text/javascript" src="static/jQuery3.1.1.js"></script>
<script type="text/javascript" src="static/simplePost.js"></script>
</head>
<body>
<h1>Paths</h1>
<table>
<tr>
<td> Origin </td>
<td> <input type="text" id="origin" value="" size="8" /> </td>
</tr>
<tr>
<td> Destination </td>
<td> <input type="text" id="destination" value="" size="8" /> </td>
</tr>
<tr>
<td> </td>
<td> <input type="submit" value="Go!" id="findPath" /> </td>
</tr>
</table>
<div id="displayArea">
</div>
</body>
</html>
};
declare
%rest:POST
%rest:form-param("origin","{$origin}", "")
%rest:form-param("destination","{$destination}", "")
%output:method("html")
%rest:path("/rail/a2bp")
function scheduleGui:a2b($origin, $destination) {
if($origin != "") then (<p> Find path from {$origin} to {$destination} </p>),
<ul> {
for $path in path:DFSSpec($origin, $destination, "up")
return
<li>{$path}</li>
} </ul>
};