* Copyright (C) 2014 Zach Melamed
* Latest version available online at https://github.com/zach-m/tectonica-commons
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
@ManagedBeans. It extends
, which normally handles invocations of
@PreDestroy, by also adding dependency-injection for
@ManagedBeans using the Guice injector created in
. This creator, by the way, also handles
@PostConstructmethods, so we make sure to avoid double invocation here.
To use, add the following paragraph to
web.xml alongside your other JSF configuration:
<context-param> <param-name>com.sun.faces.injectionProvider</param-name> <param-value>com.tectonica.guice.GuiceJsfInjector</param-value> </context-param>NOTE: make sure your
-subclass is an active listener in the
web.xml, or NullPointerExceptions will be thrown
// @PostConstruct is already handled in classes we injected