0

I am migrating application to JSF 1.2 to JSF 2.0,I am facing issue when i open a new popup window in jsf 2.0,when i open a window jsf 2 create a new view for page1.jsf and another view for page1.xhtml.it creates two views for same page the only difference is of suffix. when it create second view all my query param got lost which results a blank popup windows.

servlet mapping is web.xml is :

<servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.jsf</url-pattern>
</servlet-mapping>
user2470719
  • 31
  • 1
  • 5
  • 1
    I would suggest drop the `*.jsf` pattern and change it by `*.xhtml` instead. – Luiggi Mendoza Jan 07 '14 at 01:49
  • i had changed it,but when i open a new window in browser using popup script,h:command button is clicked on body load but it don't execute my action which i define in my button. – user2470719 Jan 07 '14 at 17:36

1 Answers1

0

Change the Web.xml file

<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
            xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
            id="WebApp_ID" version="2.5">


        <servlet>
            <servlet-name>facesServlet</servlet-name>
            <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
            <load-on-startup>1</load-on-startup>
        </servlet>

        <servlet-mapping>
            <servlet-name>facesServlet</servlet-name>
            <url-pattern>/faces/*</url-pattern>
        </servlet-mapping>
        <servlet-mapping>

            <servlet-name>facesServlet</servlet-name>
            <url-pattern>*.jsf</url-pattern>
        </servlet-mapping>

        <servlet-mapping>
            <servlet-name>facesServlet</servlet-name>
            <url-pattern>*.faces</url-pattern>
        </servlet-mapping>

        <servlet-mapping>
            <servlet-name>facesServlet</servlet-name>
        <url-pattern>*.xhtml</url-pattern>
        </servlet-mapping>

Details Migration of JSF2.0 follow this link....

Migrating from JSF 1.2 to JSF 2.0

Community
  • 1
  • 1
Pravin
  • 103
  • 1
  • 14