Ticket #31398
Question
In m-Power can we change the URLs from the long string version to a shorter version. Here are a few examples of what I'm talking about. Current: http://xxx.xxx.xx.xx.com:8011/mrcjava/servlet/SERVICECENTER.I00010s?pageName=contact-us.html Desired: http://xxx.xxx.xx.xx.co/contact-us.html
Answer
You can shorten any base URL you'd like via the web.xml file on the server (.../m-power/mrcjava/WEB-INF/). Every application built in m-Power gets written to this xml file as a servlet entry. This file is more or less a master list of applications Apache Tomcat will allow you to run. As an example, a Retrieval 1 (I00001s) that lives in a dictionary named 'MRCDXTRAIN' by default would be written in the web.xml as: <servlet> <servlet-name>MRCDXTRAIN_I00001s</servlet-name> <servlet-class>MRCDXTRAIN.I00001s</servlet-class> </servlet> <servlet-mapping> <servlet-name>MRCDXTRAIN_I00001s</servlet-name> <url-pattern>/servlet/MRCDXTRAIN.I00001s</url-pattern> </servlet-mapping> You can change the <url-pattern> value to modify the URL used to find the servlet like so: <servlet> <servlet-name>MRCDXTRAIN_I00001s</servlet-name> <servlet-class>MRCDXTRAIN.I00001s</servlet-class> </servlet> <servlet-mapping> <servlet-name>MRCDXTRAIN_I00001s</servlet-name> <url-pattern>/contact-us</url-pattern> </servlet-mapping> You can still pass URL parameters to the application itself even once you modify the URL.
Asked on April 26, 2021