简体   繁体   中英

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. 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.

I have the following xml configurations:

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:

    <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:

    <?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

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.

If anyone is interested, this issue is most likely caused by a know bug in 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM