0

I had a managed bean called controlBean and i deleted it. Then i tried to add a new bean with the same name. I also had deleted it from faces-config.xml file, which was looking like this:

<managed-bean>
    <managed-bean-name>controlBean</managed-bean-name>
    <managed-bean-class>com.app.managedbeans.ControlBean</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
</managed-bean>

The problem is, even though i specify its name as controlBean again, NetBeans calls it controlBean1, and if i delete and add again it is called controlBean2 etc. Does anyone know the reason? What can i see to fix it?

Thanks

4

2 回答 2

1

Please check you have added a default constructors for other managed beans. I had the same issue with Netbeans 7.3. I have used annotations instead in that case. I added some methods to the few other beans. Stopped the GlassFish server. Deleted the dis and build folders manually. Clean and build the project again. Ant that error was not there for the time being. Don't know the exact cause. I had to do this few times for other beans as well. If still not response, create a new bean and let it be there until a proper solution is available.

于 2013-07-14T13:14:19.410 回答
0

Get rid of all this XML and use the @ManagedBean annotation.

于 2013-07-14T03:43:18.700 回答