目标无法访问,标识符' growlT'解析为null

时间:2018-05-07 13:44:59

标签: jsf

我希望弹出窗口中的JSF错误消息而不是内联。似乎在JSF中没有简单的方法,所以使用primefaces growl组件。https://www.primefaces.org/showcase/ui/message/growl.xhtml

但是收到此错误: 目标无法访问,标识符' growlT'解析为null

托管Bean

import javax.faces.bean.SessionScoped;
@SessionScoped

@ManagedBean(name="growlT")
public class GrowlView {

    private String message;

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

XHTML:

    <table>
        <tbody>
            <tr>
                <td align="left">Message:</td>
                <td style="width: 5px">&#160;</td>
                <td><h:inputText styleClass="inputText" id="message1"
                        value="#{growlT.message}">
                    </h:inputText>
                </td>
            </tr>
        </tbody>
    </table>
    <h:commandButton styleClass="commandButton" type="submit"
        value="Submit" id="growlT1" actionListener="#{growlT.saveMessage}" update="growl">
    </h:commandButton>

有人可以帮助我吗?

0 个答案:

没有答案