问题
I want to access a @ManagedBean from Project 2 in a different Project 1, but it's value is always null. I tried to add a src/main/webapp/META-INF/faces-config.xml file to Project 2, but it didn't help.
Project 2 is added as a .jar in Project 1. The issue I'm facing is that the .jar doesn't contain the META-INF/faces-config.xml file.
How can I have this file correctly added to the .jar during my maven project build?
回答1:
You need to place faces-config.xml in src/main/resources/META-INF. If you're building a .jar, having a webapp folder doesn't make any sense.
So be sure you have it in src/main/resources/META-INF/faces-config.xml.
来源:https://stackoverflow.com/questions/15551372/access-managed-bean-classes-from-a-different-project