How to access init-param(defined in web.xml) in mock script dispatcher
Created a mock service for an operation using Script Dispatcher.
.war file is created using Deploy as war. And deploying this war in Tomcat.
Would like to access an init-parameter which is defined in web.xml (present inside .war file) in the script dispatcher, how to do it?
The following is the snippet from web.xml and like to get value of param-name scripts.
<init-param> <description>set scripts directory</description> <param-name>scripts</param-name> <param-value>WEB-INF/scripts</param-value> </init-param>
The script dispatcher shows context, mockOperation, requestContext, log and mockRequest variables are available. Looking for right right object to use and get the value "WEB-INF/scripts" in script of mock response dispatcher.
Tried using context object, something like below, but returning No Such Method getServletConfig()
context.getServletConfig().getInitParameter('scripts')
I have no surprise when the No such method error is thrown, because, API documentation does not such public method.
Any ideas?