Jsf p:咆哮不起作用
我的咆哮不起作用,我像我找到的每一样东西一样尝试,所以我在这里问如何让我的咆哮起作用。我的xhtml非常简单,注册和登录都附带了Jsf p:咆哮不起作用,jsf,primefaces,jsf-2,growl,Jsf,Primefaces,Jsf 2,Growl,我的咆哮不起作用,我像我找到的每一样东西一样尝试,所以我在这里问如何让我的咆哮起作用。我的xhtml非常简单,注册和登录都附带了ui:include。我使用的是PrimeFaces6.0。这和建议的答案完全不同,因为那个答案不起作用 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://ww
ui:include
。我使用的是PrimeFaces6.0。这和建议的答案完全不同,因为那个答案不起作用
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:p="http://primefaces.org/ui"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
<f:view>
<h:body>
<h:form>
<p:growl id="growl" showDetail="true" sticky="true" />
<h:inputText id="Email" validatorMessage="Niepoprawny format maila" value="#{userMB.tmp.email}"
label = "Email"/>
<h:messages for="Email" style="color:red;margin:8px;" />
<br/>
<h:inputText id="firstName" validatorMessage="Pole nie moze byc puste"
value="#{userMB.tmp.firstName}">FirstName</h:inputText>
<h:messages for="firstName" style="color:red;margin:8px;" /><br/>
<h:inputText id="lastName" validatorMessage="Pole nie moze byc puste"
value="#{userMB.tmp.lastName}">LastName</h:inputText>
<h:messages for="lastName" style="color:red;margin:8px;" /><br/>
<h:inputSecret id="password" validatorMessage="Pole nie moze byc puste"
value="#{userMB.tmp.password}">Password</h:inputSecret>
<h:messages for="password" style="color:red;margin:8px;" /><br/>
<p:commandButton update="growl" actionListener="#{userMB.Register()}"
icon="ui-icon-check">Register</p:commandButton>
</h:form>
<h:panelGroup>
<ui:include src="login.xhtml" />
</h:panelGroup>
</h:body>
</f:view>
</html>
我只是在学习JSF,所以请耐心等待。如果你正在学习JSF,请从阅读开始。这里介绍了许多与jsf相关的“重要”知识,包括指向许多相关stackoverflow postsAlready的链接。编译器说它无法解析名称“:咆哮”。您缺少一个h:头。它必须永远在那里,即使清空你!它起作用了!请回答这个问题,这样我就可以接受了,现在当咆哮工作时,我的登录表单不会自动刷新。我怎么喜欢它?
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Success", "Login success"));