I need to handle HTTP requests using com.sun.net.httpserver.HttpServer
which requests are triggered by the following URL schema:
http://somehost:9000/<var>/<service>
<var>
is a parameter which is passed to the <service>
<service>
is a predefined service that the server provides
The problem is that the context path is not known at compile time (because of the <var>
) so I can not just call createContext(String path, HttpHandler handler)
. How can I bind this kind of 'dynamic' context to a specific HttpHandler
instance?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With