Is there a way to define required parameter in web.xml in java servlet

40 Views Asked by At

I am trying to create a rest api using a java servlet application. I am working with url pattern mapping using web.xml . When I validate parameters I need to do request.getParameter("name") and check whether it is null and try to match it with only string regex.

I need to know whether there is any way to define the parameter we get from the POST method request in the web.xml file. Like <init-param> where we define a variable with value, is there a way to match a parameter with regex in web.xml file?

0

There are 0 best solutions below