After some questions about WindowScoped and after an answer of BalusC I understand that I would use MyFaces CODI I should before rewrite all my previous code because I can't use Mojarra, so I would use ICEFaces because it have also the "window scope" and some other things that help me later and it is based on mojarra! Ok, now I have a big problem, and I wrote also in ICE forum at this link: http://www.icefaces.org/JForum/posts/list/0/20426.page#72064 , and it is that when I launch the application I have many of this link:
<h:form>
<h:commandLink action="#{logicBean.action('/WEB-INF/jsfpage1.xhtml')}" value="Open page1.xhtml"/>
</h:form>
the LogicBean.java (simplyfied because I would understand if the problem was locate into the others methods) is this:
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package it.cyborg.logic;
import java.io.Serializable;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.CustomScoped;
/**
*
* @author FilTen
*/
@ManagedBean(name="logicBean")
@CustomScoped(value = "#{window}")
public class LogicBean implements Serializable
{
String pageIncluded;
String pageIncludedPrev;
static String crypt="MD5";
/** Creates a new instance of LogicBean */
public LogicBean() {
}
public String getPageIncluded()
{
return this.pageIncluded;
}
public void setPageIncluded(String pageIncluded)
{
this.pageIncluded=pageIncluded;
}
public String getPageIncludedPrev()
{
return this.pageIncludedPrev;
}
public void setPageIncludedPrev(String pageIncludedPrev)
{
this.pageIncludedPrev=pageIncludedPrev;
}
public String action(String value)
{
setPageIncludedPrev(pageIncluded);
setPageIncluded(value);
return "include";
}
public String getCrypt()
{
return crypt;
}
}
when I click on one of the links a javascript open a frame that contains this error:
class com.sun.faces.mgbean.ManagedBeanCreationException
The previous version had two differnce and it worked well, the first was that it was not the implementation of ice faces core, the second was that the scope was SessionScoped!
whic could the problem be?
Thank you for all your help!
[EDIT:] I have a news: I tried to add only the Icefaces core jar into the original project and the error change: class java.lang.NullPointerException what could it be? Someone can tell me how set more verbosity on this message?
Hoi Filippo!
The information you received is NOT correct. MyFaces CODI is compatible with JSF 1.2 and 2.x --> you can use it with Mojarra as well as MyFaces Core.
BalusC: Which problems have you seen? I'm using MyFaces CODI with Mojarra since the first version without problems.
来源:https://stackoverflow.com/questions/9001426/ice-faces-and-error-in-creation-of-a-bean-in-windowscoped