i'm working in netbeans 7.0. using jsf2.0
i have class where is written this:
public void doThis() {
String url = "/NewServlet?name=irakli&last=bliadze";
FacesContext context = FacesContext.getCurrentInstance();
try {
context.getExternalContext().dispatch(url);
} catch (Exception e) {
e.printStackTrace();
} finally {
context.responseComplete();
}
}
in xhtml
<h:form id="myForm">
<h:commandButton value="Do" actionListener="#{pPRBean.doThis}" styleClass="button">
<f:attribute name="name" value="Hello"/>
</h:commandButton>
</h:form>
everything is write, but when i using p:commandButton (including xmlns:p="http://primefaces.prime.com.tr/ui") instead of h:commandButton its not calling servlet but i must use primefaces
how i can to that with
<h:form id="myForm">
<p:commandButton value="Do" actionListener="#{pPRBean.doThis}" styleClass="button">
<f:attribute name="name" value="Hello"/>
</p:commandButton>
</h:form>
to make it work