Access Managed bean classes from a different project

徘徊边缘 提交于 2019-12-11 06:15:50

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!