Re: add new mapping during runtime

Splash Forums PrettyFaces Users add new mapping during runtime Re: add new mapping during runtime

#22693

Hmmm, yeah, that’s because getMappings() returns an unmodifiable view for the list of mappings. So adding a mapping to this list won’t work. But you could use setMappings() to work around this. Just retrieve the current list of mappings and construct a new list which also contains the new mapping. Than use setMappings() to set the new mapping list.

I know that this isn’t a very nice solution, but it should work. Adding mappings dynamically is a very rare usecase nobody thought of while building the API back then. :)