[英]The project does not work with servlet 4.0 and jsf 2.3
I have a small Java EE project using CDI, JSF, BeanValidation, Servlet-api in the intellij IDEA.我在 intellij IDEA 中有一个使用 CDI、JSF、BeanValidation、Servlet-api 的小型 Java EE 项目。 My server is a glassfish 5.0.0, i read that it implements servlet 4.0, cdi 2.0, jsf 2.3 and bean validation 2.0.
我的服务器是 glassfish 5.0.0,我读到它实现了 servlet 4.0、cdi 2.0、jsf 2.3 和 bean 验证 2.0。
I have the following xml configurations:我有以下 xml 配置:
1.web.xml: 1.web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app 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-app_3_1.xsd"
version="3.1">
<!--Configurations-->
</web-app>
2.faces-config.xml: 2.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>
3.beans.xml: 3.beans.xml:
<?xml version="1.0" encoding="UTF-8"?>
<beans 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/beans_2_0.xsd">
</beans>
Now everything is fine, but when i try to change servlet 3.1 to servlet 4.0, jsf 2.2 to jsf 2.3, all jsf pages where i use expression language don't working, for example <h:commandButton action='#{bean.doSomething}' />
don't fire events现在一切都很好,但是当我尝试将 servlet 3.1 更改为 servlet 4.0、jsf 2.2 到 jsf 2.3 时,我使用表达式语言的所有 jsf 页面都不起作用,例如
<h:commandButton action='#{bean.doSomething}' />
不要触发事件
What i'm doing wrong?我做错了什么? Sorry for my english.
对不起我的英语不好。
UPDATE.更新。
I'm moving my project to maven, re-updated all the libraries and everything worked fine, so i think that the problem was in bad configurations or libraries.我正在将我的项目移至 maven,重新更新了所有库并且一切正常,所以我认为问题出在错误的配置或库中。
If anyone is interested, this issue is most likely caused by a know bug in Mojarra .如果有人感兴趣,这个问题很可能是由Mojarra 中的已知错误引起的。 After updating the default 2.3.2 javax.faces.jar to at least 2.3.3 in Glassfish 5, JSF will work again as expected.
在 Glassfish 5 中将默认的 2.3.2 javax.faces.jar 至少更新为 2.3.3 后,JSF 将按预期再次工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.