My application was running fine when the context root was '/' in application.xml file.
But after changing the context root in application.xml to 'MyApplication' it is abruptly behaving. Although I have added jboss-web.xml file with the context root added in it.
But still some images are not being shown and application is trying to run in the jboss root context.
Is there any way to check for hard coding?
Do not set the context in both the application.xml file and the jboss-web.xml file. Usually, if you have an application.xml file, it is best to set the context there only.
Have you asked the browser to display the source for the page that contains a missing picture, and dug through the source to see what the URL is for the <img> tag? That might explain what is going on.
If that does not help, please provide a specific example. This would include the actual <img> entry from the page source from the browser, and the exact location of that image file within the WAR, and the context entry in the application.xml file (assuming you removed it from jboss-web.xml).