It's possible. But you still have to provide the html contents.
B4X:
srvr.AddHandler("/user/*", "user",false)
'handler
Sub Handle(req As ServletRequest, resp As ServletResponse)
resp.ContentType = "text/html"
resp.CharacterEncoding="UTF-8"
Dim sb As StringBuilder
sb.Initialize
'sb.Append("html contents")
sb.Append("<html><body>")
sb.Append("Hello world")
sb.Append("</body></html>")
resp.Write(sb.ToString)
End Sub
Thank you very much, now I finally understand how this works.
FWIW To run the example one needs to create a class module name "user" and put that Handle sub in there, and srvr.addHandler must be called before srvr.START