これが私の見解です:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">
<h:head>
    <title>Welcome</title>
</h:head>
<h:body>
    <h:form prependId="false" id="myForm">
        <h3>Please enter your name and password.</h3>
        Name: <h:inputText id="name" value="#{user.name}"/>
        Password: <h:inputSecret id="password" value="#{user.password}"/>
        <h:commandButton value="Login">
            <f:ajax execute="name password" render="greeting"/>
        </h:commandButton>
        <h:outputText id="greeting" value="Welcome + #{user.name}" rendered="#{user.nameRendered()}"/>
    </h:form>
</h:body>
</html>
すべての私の User.java :
@Named
@SessionScoped
public class User implements Serializable {
    private String name;
    private String password;
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getPassword() {
        return password;
    }
    public void setPassword(String password) {
        this.password = password;
    }
    public boolean nameRendered() {
        return this.name != null;
    }
}
したがって、名前フィールドに何かを入力して送信をクリックすると、user.nameRendered() が true を返す必要があるため、id「greeting」の outputText が表示されるはずです。
ただし、名前を送信した後、ページを更新して表示する必要があります。理由として考えられるのはなぜですか?ページの更新が必要なのはなぜですか? ページを更新せずにそれを行うにはどうすればよいですか?