I have a problem with faces message rendering in portlet, deployed on HCL portal 9.5, which is on top of Websphere Application Server 9.0.5.7. Portlet has two pages and when I made first page navigation, faces message stops rendering.
First page html:
<div xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:portlet="http://java.sun.com/portlet_2_0"
xmlns:p="http://primefaces.org/ui">
<f:view>
<f:metadata>
<f:event listener="#{pc_TestJSF22View.init}" type="preRenderView"></f:event>
</f:metadata>
<h:head>
<h:outputScript library="primefaces" name="jquery/jquery.js" />
</h:head>
<h:body>
<h:form id="formMain" styleClass="form">
<p:commandButton id="btnTest" value="Test"
action="#{pc_TestJSF22View.doBtnTest}" />
<p:commandButton id="btnSecondPage" value="Second page"
action="#{pc_TestJSF22View.doBtnSecondPage}" ajax="false" />
<p:messages id="msgGlobal" globalOnly="true" showIcon="false">
<p:autoUpdate />
</p:messages>
</h:form>
</h:body>
</f:view>
First page request bean:
public class TestJSF22View extends PageCodeBase {
private TestSess testSess;
public void init() {
if (PrimeFaces.current().isAjaxRequest()) {
return;
}
try {
System.out.println("INIT method");
} catch (Exception e) {
System.out.println(e.getMessage());
}
}
// button action
public String doBtnSecondPage() {
return "testView2";
}
public String doBtnTest() {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("page 1 msg updated"));
return null;
}
protected TestSess getTestSess() {
if (testSess == null) {
testSess = (TestSess) getManagedBean("testSess");
}
return testSess;
}
}
Second page html:
<div xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:portlet="http://java.sun.com/portlet_2_0"
xmlns:p="http://primefaces.org/ui">
<f:view>
<f:metadata>
<f:event listener="#{pc_TestJSF22View2.init}" type="preRenderView"></f:event>
</f:metadata>
<h:head>
<h:outputScript library="primefaces" name="jquery/jquery.js" />
</h:head>
<h:body>
<h:form id="formMain" styleClass="form">
<p:commandButton id="btnFirstPage" value="First page"
action="#{pc_TestJSF22View2.doBtnFirstPage}" ajax="false" />
<p:commandButton id="btnMsg" value="Show message"
action="#{pc_TestJSF22View2.doBtnMsg}" />
<p:messages id="msgGlobal2" globalOnly="true" showIcon="false">
<p:autoUpdate />
</p:messages>
</h:form>
</h:body>
</f:view>
Second page request bean:
public class TestJSF22View2 extends PageCodeBase {
private TestSess2 testSess2;
public void init() {
if (PrimeFaces.current().isAjaxRequest()) {
return;
}
try {
System.out.println("INIT2 method");
} catch (Exception e) {
System.out.println(e.getMessage());
}
}
// button action
public String doBtnFirstPage() {
System.out.println("doBtnFirstPage method");
return "testView";
}
public String doBtnMsg() {
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("page 2 msg updated"));
return null;
}
protected TestSess2 getTestSess2() {
if (testSess2 == null) {
testSess2 = (TestSess2) getManagedBean("testSess2");
}
return testSess2;
}
}
faces-config :
<?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_2.xsd"
version="2.2">
<application>
<view-handler>com.ibm.faces20.portlet.FaceletPortletViewHandler</view-handler>
<el-resolver>com.ibm.faces20.portlet.PortletELResolver</el-resolver>
<resource-handler>com.ibm.faces20.portlet.httpbridge.PortletResourceHandler</resource-handler>
</application>
<factory>
<exception-handler-factory>org.primefaces.application.exceptionhandler.PrimeExceptionHandlerFactory</exception-handler-factory>
</factory>
<component>
<component-type>com.ibm.faces20.portlet.component.PortletActionURL</component-type>
<component-class>com.ibm.faces20.portlet.component.PortletActionURL</component-class>
</component>
<component>
<component-type>com.ibm.faces20.portlet.component.PortletResourceURL</component-type>
<component-class>com.ibm.faces20.portlet.component.PortletResourceURL</component-class>
</component>
<component>
<component-type>com.ibm.faces20.portlet.component.PortletRenderURL</component-type>
<component-class>com.ibm.faces20.portlet.component.PortletRenderURL</component-class>
</component>
<component>
<component-type>com.ibm.faces20.portlet.component.PortletParam</component-type>
<component-class>com.ibm.faces20.portlet.component.PortletParam</component-class>
</component>
<component>
<component-type>com.ibm.faces20.portlet.component.PortletProperty</component-type>
<component-class>com.ibm.faces20.portlet.component.PortletProperty</component-class>
</component>
<component>
<component-type>com.ibm.faces20.portlet.component.PortletNameSpace</component-type>
<component-class>com.ibm.faces20.portlet.component.PortletNameSpace</component-class>
</component>
<managed-bean>
<managed-bean-name>pc_TestJSF22View</managed-bean-name>
<managed-bean-class>pagecode.TestJSF22View</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>testSess</managed-bean-name>
<managed-bean-class>beans.TestSess</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>pc_TestJSF22View2</managed-bean-name>
<managed-bean-class>pagecode.TestJSF22View2</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>testSess2</managed-bean-name>
<managed-bean-class>beans.TestSess2</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<render-kit>
<renderer>
<component-family>javax.faces.Output</component-family>
<renderer-type>com.ibm.faces20.portlet.tag.render.ActionURLTagRender</renderer-type>
<renderer-class>com.ibm.faces20.portlet.tag.render.ActionURLTagRender</renderer-class>
</renderer>
</render-kit>
<render-kit>
<renderer>
<component-family>javax.faces.Output</component-family>
<renderer-type>com.ibm.faces20.portlet.tag.render.ResourceURLTagRender</renderer-type>
<renderer-class>com.ibm.faces20.portlet.tag.render.ResourceURLTagRender</renderer-class>
</renderer>
</render-kit>
<render-kit>
<renderer>
<component-family>javax.faces.Output</component-family>
<renderer-type>com.ibm.faces20.portlet.tag.render.RenderURLTagRender</renderer-type>
<renderer-class>com.ibm.faces20.portlet.tag.render.RenderURLTagRender</renderer-class>
</renderer>
</render-kit>
<render-kit>
<renderer>
<component-family>javax.faces.Output</component-family>
<renderer-type>com.ibm.faces20.portlet.tag.render.PortletNameSpaceTagRender</renderer-type>
<renderer-class>com.ibm.faces20.portlet.tag.render.PortletNameSpaceTagRender</renderer-class>
</renderer>
</render-kit>
<navigation-rule>
<from-view-id>/*</from-view-id>
<navigation-case>
<from-outcome>testView</from-outcome>
<to-view-id>/TestJSF22View.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/*</from-view-id>
<navigation-case>
<from-outcome>testView2</from-outcome>
<to-view-id>/TestJSF22View2.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config>
So, if I illustrate my problem: When I first open portlet and first page is displayed, I click "Test" button, that displays faces message. Next, I navigate to second page and I click "Show message" button, which should display another message on second page, but it doesn't. I get the following warning:
There are some unhandled FacesMessages, this means not every FacesMessage had a chance to be rendered.
These unhandled FacesMessages are:
- page 2 msg updated
Even if I go back to the first page again and hit "Test" button one more time, message is not displayed and the same warning is what I get.
I never had problems with faces messages when I deployed portlets on IBM Websphere Portal Server 7 with JSF 2.0, but now when I run it on HCL portal 9.5 (JSF 2.2), I noticed this strange behavior.
Did I miss something while migrating to HCL portal?
Primefaces version is 7.0, p:messages usage seems ok to me. Could HCL portlet bridge cause that problem? Does anyone have experience with deploying JSF portlets on HCL Portal?
EDIT1:
I've just tried to deploy web application with identical code on Websphere Application Server 9 and it works like a charm. Based on that I believe there's some problem with HCL Portal.
Related
I am trying to mimic the PrimeFaces Dialog example. For some reason that I am not able to find, my PrimeFaces button does not seem to call the required managed bean method:
<h:form>
<p:commandButton value="Open" icon="ui-icon-extlink" actionListener="#{myController.createDialog()}" />
</h:form>
Managed bean:
#Named(value = "myController")
#ViewScoped
public class MyController implements Serializable {
public void createDialog() {
System.out.println("%%%%%%%%%%%%%%%%%%%%%%%%%");
...
The print statement is never executed, like if the Listener was not working. When I click the button, no response is given. No backend error, no JS error, nothing. I only see that some request is done because I log when a user passes the authorization layer. So something happens but seems to fail silently.
What I have tried:
Move the button to other places in the page
Use an id:
<p:commandButton id="ex" value="Open" icon="ui-icon-extlink" actionListener="#{myController.createDialog()}" />
<h:message for="ex" />
Remove the ViewScoped
Require a javax.faces.event.ActionEvent in the method
public void createDialog(ActionEvent event) {
System.out.println("%%%%%%%%%%%%%%%%%%%%%%%%%");
Change the method signature
action="#{myController.createDialog(5)}"
and
public void createDialog(int s) {
System.out.println("%%%%%%%%%%%%%%%%%%%%%%%%%");
I even tried to create a WEB-INF/faces-config.xml (which I would prefer not to, and according to PrimeFaces documentation I do not need it) with:
<?xml version='1.0' encoding='UTF-8'?>
<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">
<application>
<action-listener>org.primefaces.application.DialogActionListener</action-listener>
<navigation-handler>org.primefaces.application.DialogNavigationHandler</navigation-handler>
<view-handler>org.primefaces.application.DialogViewHandler</view-handler>
</application>
<lifecycle>
<phase-listener>org.primefaces.component.lifecycle.LifecyclePhaseListener</phase-listener>
</lifecycle>
Other answers I have checked are: 1, 2, 3, 4, 5, 6
Apparently the use of actionListeners in PrimeFaces is not as correct as it should be... Is there another way to use PrimeFaces components?
This Dialog Framework code works for me:
index.xhtml
<p:commandButton id="openDialogButton" value="open dialog" action="#{myBean.openDialog('origin')}">
<!-- dialogReturn event: data could be passed, see page 587 in PF 6.1 manual. -->
<p:ajax event="dialogReturn" listener="#{myBean.doSthOnDialogReturn}"/>
</p:commandButton>
myDialogPage.xhtml
<p:commandButton id="closeButtonDialog" value="close dialog"
action="#{myBean.closeDialog('false')}"/>
<p:commandButton id="closeButtonDialog2" value="close dialog 2"
action="#{myBean.closeDialog('true')}"
ajax="false" validateClient="true"/>
Note: Example shows how to pass parameter from dialog. You can also notice, that the first button does just return while the second one does validation at first. I think these things can be useful.
myBean.java
public void openDialog(String origin) {
RequestContext.getCurrentInstance().openDialog("myDialogPage",
options, null);
}
public void closeDialog(Boolean param) {
RequestContext.getCurrentInstance().closeDialog(param);
}
public void doSthOnDialogReturn(SelectEvent event) {
if ((Boolean) event.getObject()) { // retrieve param value
doSth();
}
}
WEB-INF/faces-config.xml
<application>
<action-listener>
org.primefaces.application.DialogActionListener
</action-listener>
<navigation-handler>
org.primefaces.application.DialogNavigationHandler
</navigation-handler>
<view-handler>
org.primefaces.application.DialogViewHandler
</view-handler>
</application>
Finally I got to see some error:
SEVERE - /page.xhtml #159,146 actionListener="#{myController.createDialog()}": Target Unreachable, identifier 'myController' resolved to null
The trick to enable the display of error messages was to add the following in faces-config.xml:
<factory>
<exception-handler-factory>org.primefaces.application.exceptionhandler.PrimeExceptionHandlerFactory</exception-handler-factory>
</factory>
After checking this, I realised that my beans.xml file had been somehow deleted (??)
I have a button, when i click a modal panel opened - it's work fine. Now i tried to add a button to hide the panel - it's work also, but the problem is when i tried to show a text "panel closed" after button click it doesn't work. I use Jsf 1.2 and richfaces 3.3.3.
I have the following error message:
org.apache.jasper.el.JspELException: /index.jsp(35,7) 'javascript:Richfaces.hideModalPanel('myModalPanel');#{welcomeBean.showText(true)}' Method not found: class com.firstjsf.backingbeans.WelcomeBean.showText(java.lang.Boolean) at org.apache.jasper.el.JspValueExpression.getValue(JspValueExpression.java:123)
above the code:
index.jsp
<%#taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%#taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%# taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%# taglib uri="http://richfaces.org/rich" prefix="rich"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<f:view>
<h:form>
<rich:panel>
<f:facet name="header">
<h:outputText value="Product"></h:outputText>
</f:facet>
<h:form>
<a4j:commandButton
id="newWid"
value="New Widget..."
immediate="true" ajaxSingle="true"
reRender="text"
oncomplete="javascript:Richfaces.showModalPanel('myModalPanel');"
styleClass="verboseButton noprint" />
</h:form>
<rich:modalPanel id="myModalPanel">
<f:facet name="header">
<h:outputLabel value="123" />
</f:facet>
From Modal Panel
<a4j:commandButton value="Hide" id="btn_hide"
oncomplete="javascript:Richfaces.hideModalPanel('myModalPanel');#{welcomeBean.setShowText(true)}" />
</rich:modalPanel>
<h:outputText id="text"
value="Panel closed"
rendered="#{helloMessage.showText eq true}">
</h:outputText>
</rich:panel>
</h:form>
</f:view>
</html>
faces-config.xml
<?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_1_2.xsd"
version="1.2">
<managed-bean>
<managed-bean-name>welcomeBean</managed-bean-name>
<managed-bean-class>com.firstjsf.backingbeans.WelcomeBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>helloMessageBean</managed-bean-name>
<managed-bean-class>com.firstjsf.backingbeans.HelloMessageBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<navigation-rule>
<description>Welcome page to message page</description>
<from-view-id>/index.jsp</from-view-id>
<navigation-case>
<from-outcome>helloMessage</from-outcome>
<to-view-id>/message.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<description>Welcome page to message page</description>
<from-view-id>/message.jsp</from-view-id>
<navigation-case>
<from-outcome>back</from-outcome>
<to-view-id>/index.jsp</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config>
BeanAction
public class WelcomeBean {
private boolean showText =false;
public String sayHello(){
return "helloMessage";
}
public boolean isShowText() {
return showText;
}
public void setShowText(boolean showText) {
this.showText = showText;
}
}
You're mixing JavaScript and EL expressions, #oncomplete is for executing JavaScript, if you want to do something on the server use #action or #actionListener. Otherwise the expression will be evaluated and the browser will try to execute the return value as if it was JavaScript.
By the way, your code shows you're using setShowText(true) (which is correct), but the exception says you're using just showText(true), which is it then?
Can't get PrimeFaces RequestContext.getCurrentInstance().openDialog() to work. I lifted the example code right out of the primefaces showcase, but I never get a dialog to open up. I'm using PF 5.1 running on Wildfly 8.2.0.Final. Any ideas what's up?
DFView.java
#ManagedBean(name = "dfView")
public class DFView {
public void chooseCar() {
RequestContext.getCurrentInstance().openDialog("selectCar");
}
public void onCarChosen(SelectEvent event) {
Car car = (Car) event.getObject();
FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, "Car Selected", "Id:" + car.getId());
FacesContext.getCurrentInstance().addMessage(null, message);
}
}
and my dialogplay.xhtml
<!DOCTYPE html>
<ui:composition xmlns="http://www.w3.org/1999/xhtml" template="/WEB-INF/templates/template.xhtml"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets" xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:p="http://primefaces.org/ui">
<ui:define name="body">
<h:form>
<p:growl id="growl" showDetail="true" />
<p:commandButton value="Select Car" icon="ui-icon-extlink" actionListener="#{dfView.chooseCar}">
<p:ajax event="dialogReturn" listener="#{dfView.onCarChosen}" update="growl" />
</p:commandButton>
</h:form>
</ui:define>
</ui:composition>
Please check "selectCar" is a valid Navigation Rule in your faces-config which references dialogplay.xhtml. (or use wittakarn's solution, which is easier)
If that is the Case, check that your faces-config contains the Dialog Framework Configuration (Page 519 in the Primefaces 5.1 Users Guid, it's easy to miss):
<application>
<action-listener>
org.primefaces.application.DialogActionListener
</action-listener>
<navigation-handler>
org.primefaces.application.DialogNavigationHandler
</navigation-handler>
<view-handler>
org.primefaces.application.DialogViewHandler
</view-handler>
</application>
I am trying to do a simple test before I dive into a large activity. But, here is where I was stuck. The test is to submit the JSF form, but the managed bean action never gets triggered.
<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:ice="http://www.icesoft.com/icefaces/component">
<f:view>
<head>
<title>A B C</title>
</head>
<body>
<h:form id="test">
<h:inputText value="demo"/>
<h:commandButton type="submit" value="A button" action="#{User.better}" immediate="true" />
</h:form>
</body>
</f:view>
</html>
Here is my managed bean
public class User {
public String send() {
System.out.println("Submitting data.....");
return null;
}
public void better() {
System.out.println("In better...");
}
}
I have set all the configurations correctly. I could be able to see the page. But,the control never gets into action method. How come? Any suggestions would be great.
UPDATE:
Here is my faces-conig.xml
<?xml version="1.0" encoding="UTF-8"?>
<faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xi="http://www.w3.org/2001/XInclude" 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_1_2.xsd">
<application>
<view-handler>com.icesoft.faces.facelets.D2DFaceletViewHandler</view-handler>
</application>
<managed-bean>
<managed-bean-name>User</managed-bean-name>
<managed-bean-class>com.srk.beans.User</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
</faces-config>
I have changed the managed-bean-name from User to user(small case) and changed the same in the .xhtml page as well, but seems to be same problem still.
Try user instead of User.Thus, try put user.better instead of User.better. Are you using jsf 2 or no? Also, post your faces-config file
Support for an action method with a void return type did not show up in JSF until v2.x. You must specify a return type of at least Object for better
public Object better() {
System.out.println("In better...");
return null;
}
I have made a Login.xhtml by using Apache Myfaces 2.1 (using JSF 1.x)
When I have given my username and password on login.xhtml and one submit button is there.
When I click on goodbye button, the control goes to wsListing.xhtml but the URL in the browser remain as
http://hostid:8080/TestClient/faces/login.xhtml
I want it to be changed as
http://hostid:8080/TestClient/faces/wsListing.xhtml
I have attached the code for the same, please suggest me some solution, I am new to JSF.
Login.xhtml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui" xmlns:lang="en">
<f:view>
<head>
<title>Test Client Login</title>
</head>
<h:form id="loginForm">
<table>
<tr>
<h:outputLabel for="username">
<h:outputText id="usernameLabel" value="Enter Username:" />
</h:outputLabel>
<h:inputText id="username" value="#{loginBean.username}"
required="true">
<f:validateLongRange minimum="1" maximum="500" />
</h:inputText>
</tr>
<tr>
<h:outputLabel for="password">
<h:outputText id="passwordLabel" value="Enter Password:" />
</h:outputLabel>
<h:inputText id="password" value="#{loginBean.password}"
required="true">
<f:validateLongRange minimum="1" maximum="500" />
</h:inputText>
</tr>
<tr>
<h:commandButton id="goodbyeCommand" type="submit" value="Goodbye"
action="#{loginBean.goodbye}" immediate="true" />
</tr>
</table>
</h:form>
</f:view>
</html>
LoginBean.java
package com.example;
/**
* Managed Bean for Login
*
*/
public class LoginBean {
private String username;
private String password;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String goodbye() {
return "success";
}
}
faces-config.xml
<?xml version="1.0"?>
<faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xi="http://www.w3.org/2001/XInclude" 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_1_2.xsd">
<managed-bean>
<description>Login Bean</description>
<managed-bean-name>loginBean</managed-bean-name>
<managed-bean-class>com.example.LoginBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<navigation-rule>
<description>Navigation from the hello page.</description>
<from-view-id>/login.xhtml</from-view-id>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/wsListing.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config>
You need to send a redirect. Add <redirect /> to the <navigation-case />.
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/wsListing.xhtml</to-view-id>
<redirect />
</navigation-case>
Unrelated to the concrete problem, MyFaces 2.1 is a JSF 2.1 implementation. Why are you forcing the webapp to run in JSF 1.2 modus? You miss so many JSF 2.x advantages.