具有以下代码段:
豆:
import javax.faces.view.ViewScoped;
import javax.inject.Named;
@Named(value = "directoryBean")
@ViewScoped
public class DirectoryBean implements Serializable {
private static final long serialVersionUID = 1L;
....
}
Run Code Online (Sandbox Code Playgroud)
faces-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<faces-config
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_3.xsd"
version="2.3">
....
</faces-config>
Run Code Online (Sandbox Code Playgroud)
group.xhtml
<ui:composition ...>
<f:metadata>
<f:viewParam name="id" value="#{directoryBean.id}" />
</f:metadata>
</ui:composition>
Run Code Online (Sandbox Code Playgroud)
结果得到异常:
javax.el.PropertyNotFoundException: /group.xhtml @6,64 value="#{directoryBean.id}": Target Unreachable, identifier 'directoryBean' resolved to null
Run Code Online (Sandbox Code Playgroud)
在将faces-config.xml从2.2版语法更改为2.3版语法后得到了它。
意思是,使用带有以下内容的faces-config.xml,一切正常:
<faces-config version="2.2" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd">
....
</faces-config>
Run Code Online (Sandbox Code Playgroud)
JSF 2.3.2部署在Payara 4.1.2.172(完整)服务器上,并且还添加到pom.xml中,“提供”范围。
....
<dependencies>
...
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.faces</artifactId>
<version>2.3.2</version>
<scope>provided</scope> …Run Code Online (Sandbox Code Playgroud) 在 Solr 6.x 中,我在托管模式中有以下行来忽略未映射的字段:
<dynamicField name="*" type="ignored" multiValued="true" />
Run Code Online (Sandbox Code Playgroud)
这一行告诉 Solr 6.x 忽略所有未映射/未命名的字段,并且在 Solr 7.0.0 之前工作正常。
似乎 Solr 7.0.0 不再支持type="ignored"并给出“忽略”是未知类型的异常。
经过一些测试、Solr 7 代码审查等,到目前为止我发现的唯一解决方案是具有以下行:
<dynamicField name="*" type="text_general" multiValued="true" indexed="false" stored="false"/>
Run Code Online (Sandbox Code Playgroud)
似乎它工作正常,但是忽略未映射的字段(未由托管模式明确映射/命名的字段)的最合适/有效的解决方案(配置)是什么?
谢谢!