Annotation API sample project in Spring Java

Hi,


I noticed the following lines in the mvc-config.xml in the provided spring sample:


Can you explain me what is it for? Especially the first line is strange as it contains the webapp name in the mapping. That means that if I rename the .war archive I need to modify that file as well, is that correct? Can I remove that line? Concerning the second line - if I want to embed the viewer one level down, can/should I change that mapping to be /viewer/assets/** ?

Thanks in advance for your help,
Mariusz
Hi Mariusz,

Sure, I’ll explain these directives. resources Spring directive maps resource URLs (requests) to the physical location. In this particular case, it maps /document-viewer/assets/** resources to be loaded from the /assets/ folder of the GroupDocs.Annotation jar file.

Better not to remove these lines, even the first one, because here “document-viewer” is not the name of the war file it’s a part of the request URL. You can examine network tab in your browser developer tools. There are requests with “document-viewer” part.

You can try to modify these resources directives but make it sure to correlate with applicationPath configuration setting.