2

I'm trying to switch an application from WildFly 13 (Java EE 7, JSF 2.2.15) to WildFly 16 (Java EE 8, JSF 2.3.9). Tried both PrimeFaces 6.2 and 7.0

In web.xml javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL is set. JSF 2.2 version working fine, switching to WildFly 16 this different behavior. A simple example follows:

Instructions: access: http://localhost:8080/primefaces-test/?tipo=U&test=Bah click first button, click second button. after ajax the viewParam value in the bean is null, even it is filled within the url.

Sample project (Jetty): https://github.com/erickdeoliveiraleal/primefaces-test/tree/update

XHTML

 <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:p="http://primefaces.org/ui"
    xmlns:h="http://java.sun.com/jsf/html">
<f:metadata>

    <f:viewParam name="test" value="#{testView.testString}" />
    <f:viewAction action="#{testView.inicializar}" />

</f:metadata>
<h:head>
    <title>PrimeFaces Test</title>
</h:head>
<h:body>

    <h:form id="cadastro">
        <h:commandButton value="click me"
            action="#{testView.inserirNaLista()}">
            <f:ajax execute="@form" render="@form" />
        </h:commandButton>
        <p:commandButton
            value="click me - 2 (this button causes the null value)"
            action="#{testView.inserirNaLista()}" />

    </h:form>


</h:body>
</html>

Bean

@ManagedBean(name = "testView")
@ViewScoped
public class TestView implements Serializable {
    private String testString;

    public void inicializar() {
        System.out.println("initializing: " + testString);

    }

    public void inserirNaLista() {
        System.out.println(testString);
    }

    public String getTestString() {
        return testString;
    }

    public void setTestString(String testString) {
        this.testString = testString;
    }

}
erickdeoliveiraleal
  • 708
  • 2
  • 9
  • 21
  • Comments are not for extended discussion; this conversation has been [moved to chat](https://chat.stackoverflow.com/rooms/190200/discussion-on-question-by-erickdeoliveiraleal-using-javax-faces-interpret-empty). – Bhargav Rao Mar 17 '19 at 13:48
  • 2
    Hi Erick, how did you solve it ? as I have the exact problem now: https://stackoverflow.com/questions/58541368/jsf-viewscope-bean-viewparam-ajax-request-update-the-mb-attribute-with-null/58700683#58700683 – Videanu Adrian Nov 05 '19 at 05:57
  • There's another bug related to viewParam. I opened a issue github.com/eclipse-ee4j/mojarra/issues/4734 – erickdeoliveiraleal Oct 17 '20 at 17:47

1 Answers1

0

fixed in WildFly 21 https://github.com/eclipse-ee4j/mojarra/issues/4550 and still pending official release in eclipse-ee4j

erickdeoliveiraleal
  • 708
  • 2
  • 9
  • 21