hi
i would like to know how i can in the Server Handler map a dynamic url. something like this:
url to call it: http://localhost:3000/users/34/books/8989
now i know i can add the * at the end of the handler url and do it like this:
and then call something like this:
and get the values like this:
but my question is can i do it without adding the value keys in the url?
so i want to reach the handler with this URL: http://localhost:3000/users/34/books/8989
and not with this: http://localhost:3000/users?userid=0081&bookid=0021
this is what i found but cannot figure out what i need to do.
stackoverflow.com
thanx, ilan
i would like to know how i can in the Server Handler map a dynamic url. something like this:
B4X:
'app.get('/users/:userId/books/:bookId',function (req,res){
' //...
'})
url to call it: http://localhost:3000/users/34/books/8989
now i know i can add the * at the end of the handler url and do it like this:
B4X:
srvr.AddHandler($"/users/*"$, "books", False)
and then call something like this:
and get the values like this:
B4X:
Sub Handle(req As ServletRequest, resp As ServletResponse)
Log(req.GetParameter("userid"))
Log(req.GetParameter("bookid"))
resp.Write("processing...")
End Sub
but my question is can i do it without adding the value keys in the url?
so i want to reach the handler with this URL: http://localhost:3000/users/34/books/8989
and not with this: http://localhost:3000/users?userid=0081&bookid=0021
this is what i found but cannot figure out what i need to do.
![stackoverflow.com](/android/forum/proxy.php?image=https%3A%2F%2Fcdn.sstatic.net%2FSites%2Fstackoverflow%2FImg%2Fapple-touch-icon%402.png%3Fv%3D73d79a89bded&hash=a2b1684a43741cdc676981116b6f66e4&return_error=1)
Jetty '{servlet}/{parameter}' url routing
I'm using jetty 9.0.3. How to map an URL such as www.myweb.com/{servlet}/{parameter} to the given servlet and parameter? For example, the URL '/client/12312' will route to clientServlet and its d...
thanx, ilan