WARN [Parameters]参数:无效的块被忽略.警告出现在primefaces应用程序中 [英] WARN [Parameters] Parameters: Invalid chunk ignored. warning coming in primefaces application

查看:106
本文介绍了WARN [Parameters]参数:无效的块被忽略.警告出现在primefaces应用程序中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试构建基于JSF 2的示例自动完成表单.我正在使用primefaces 3.0.M2,JSF 2.1.2库和JBoss 6.

I am trying to build sample JSF 2 based autocomplete form. I am using primefaces 3.0.M2, JSF 2.1.2 libraries and JBoss 6.

我正在使用primefaces的autoComplete组件,但无法正常工作.当我在输入文本框中键入内容时,没有得到任何自动完成的文本.

I am using autoComplete component of primefaces but its not working. I am not getting any autocomplete text when I type in input text box.

在JBoss控制台窗口中,我只能看到以下警告:

I can see only following warning in JBoss console window :

19:40:56,874 WARN  [Parameters] Parameters: Invalid chunk ignored.

我的xhtml文件如下所示:

My xhtml file looks like following :

<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:p="http://primefaces.prime.com.tr/ui">
    <h:head>
       <title>sample auto completer</title> 
    </h:head>
    <h:body>
        <p:messages id="messages" />
        <p:autoComplete id="AutoCompleter" 
            value="#{myBean.text}" 
            completeMethod="#{myBean.complete}"
            onSelectUpdate="messages"/>
    </h:body>
</html>

和Java bean代码如下:

and java bean code is as follows :

package com.shekhar.jsf;

import java.util.ArrayList;
import java.util.List;

public class Bean {

    private String text;

    public List<String> complete(String val) {
        List<String> lst = new ArrayList<String>();

        for (int i = 0; i < 10; i++) {
            lst.add(val + i);
        }
        return lst;
    }

    public void setText(String text) {
        this.text = text;
    }

    public String getText() {
        return text;
    }
}

并且我的faces-config文件包含以下代码:

and my faces-config file contains following code :

<?xml version="1.0" encoding="UTF-8"?>
<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
    version="2.0">
    <managed-bean>
        <managed-bean-name>myBean</managed-bean-name>
        <managed-bean-class>com.shekhar.jsf.Bean</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>
</faces-config>

我不明白我想念的是什么.请帮忙!!!

I dont understand which thing I am missing. Please help !!!

推荐答案

根据上面的评论作为公认的答案

From the comment above as the accepted answer

您应该在控制台或System.out.println()的日志文件中看到输出.如果您没有这样做,则意味着complete方法没有得到执行.可能是因为您需要将自动完成和消息组件包装在<h:form prependId="false">中.

You should see output in the console or in the log files for System.out.println(). If you did not then that means the complete method is not getting executed. It might be because you need to wrap your autoComplete and messages components in an <h:form prependId="false">.

很高兴看到它为您工作.看起来很奇怪,但是JSF和ASP.NET之间有很多相似之处.我曾经是ASP.NET开发人员,并且选择JSF非常容易.祝你好运!

Glad to see it worked for you. It may seem strange but there are a LOT of similarities between JSF and ASP.NET. I used to be an ASP.NET developer and I picked up JSF fairly easy. Good luck!

这篇关于WARN [Parameters]参数:无效的块被忽略.警告出现在primefaces应用程序中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆