Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ajax/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jsf:ajax标记破坏请求_Ajax_Spring_Jsf_Jsf 2 - Fatal编程技术网

jsf:ajax标记破坏请求

jsf:ajax标记破坏请求,ajax,spring,jsf,jsf-2,Ajax,Spring,Jsf,Jsf 2,我在JSF中使用Spring 我有一个视图范围的bean,它包含一个函数,xhtml文件包含一个下拉菜单,该菜单在值更改时更新一些消息给用户,还有一个按钮调用该函数。当我更改下拉列表并单击按钮时,不会调用该函数 移除标签后 ,函数被调用,并且工作正常 这是一个和过去一样的问题 xhtml 在将更改为时,任何解释都可能是在将响应发送到客户端后尝试写入响应缓冲区,可能是在这一行之后,context.getExternalContext().redirect(“/page.xhtml”)或者请求在

我在JSF中使用Spring

我有一个视图范围的bean,它包含一个函数,xhtml文件包含一个下拉菜单,该菜单在值更改时更新一些消息给用户,还有一个按钮调用该函数。当我更改下拉列表并单击按钮时,不会调用该函数

移除标签后
,函数被调用,并且工作正常

这是一个和过去一样的问题

xhtml



在将
更改为
时,任何解释都可能是在将响应发送到客户端后尝试写入响应缓冲区,可能是在这一行之后,
context.getExternalContext().redirect(“/page.xhtml”)或者请求在这一行之前已经被转发/调度。是的,当我更改下拉列表时,似乎是ajax编写了响应
@Scope("view")
@Component("propertyBean")
public class PropertyBean implements Serializable {
    ...
    public String update() {
    ...
       return"/page.xhtml";
    }
}
<h:selectOneMenu id="type" required="true"
    requiredMessage="#{msgBean.getRequired()}"
    styleClass="btn btn-white dropdown-toggle" style="width:100%"
    value="#{propertyBean.property.propertyDetails.type}"
    converter="#{typeConverter}">
    <f:selectItem itemValue="#{null}" itemLabel="choose item"
    noSelectionOption="true" />
    <f:selectItems value="#{dataBean.availableTypes}"
    var="typeObj" itemValue="#{typeObj}"
    itemLabel="#{typeObj.type}"/>
    <f:ajax event="blur" render="type_message" />
</h:selectOneMenu>
<h:message id="type_message" for="type"
    infoClass="help-block" errorClass="help-block error" />


    <h:commandButton id="update" value="save"
    onclick="if( validate('submitForm')==true){ updateProperty();} else{ return false;}"
    action="#{propertyBean.update}"
    class="btn btn-green btn-lg arabic"
    rendered="#{propertyBean.isNew == false}">
    <f:param name="propertyId" value="#{propertyBean.property.id}">
    </f:param>
</h:commandButton>