I'm sorry, I come from a PHP web world.
I'm used to using a router in frameworks like Laravel to send to controllers and get parameters. I know how to get get
and post
parameters using servlets by routing things with the web.xml
servlet-mapping
and using *
wildcards, but am unfamiliar with how to get those url wildcards with the HttpServletRequest
variable passed through doGet
or doPost
.
Is there anything where I can grab the wildcards of those urls, such as, if the url was a username or a particular page I didn't want to hard code into the web.xml? I'm sure there is.
Id like to know things like what I can get in PHP's $_SERVER
variables for reading data about the incoming request. Stuff like cookies are also needed. Can someone give me a quick pointer with Java Servlets?
EDIT:
Or maybe I should just stick the variables to where variables belong and not make "pages" out of fake variables. I'm also open to that idea as well.
My main problem is that I don't know how to get url wildcards in doGet
or doPost
after it's routed from web.xml, so I'd either like to know how or be told that's a stupid thing to do and not do it at all.