ViewExpiredException when submitting JSF form to different host - jsf-2

I want to create login functionality for Admin so that admin can login (from Admin-portal) as any user (in User-portal). (These are two different portal running in two different host).
In Admin-portal, I have have written
<p:dialog>
<form action="http://user-portal.com/index.jsf" method="post"
target="_blank">
<h:inputHidden id="adminId" value="#{userListBean.openAdminId}"></h:inputHidden>
<h:inputHidden id="clientId" value="#{userListBean.openClientId}"></h:inputHidden>
<!-- some other security parameters -->
<input type="submit" value="login"></input>
</form>
</p:dialog>
Problem is in User-portal.
index.jsf
<h:body>
#{customLogin}
</h:body>
CustomLogin bean
#Named("customLogin")
#SessionScoped
public class CustomLogin implements Serializable {
.
.
#PostConstruct
public void customLoginPage() {
HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance()
.getExternalContext().getRequest();
Map<String, String[]> requestParaMap = request.getParameterMap();
// some admin and user validation and setting other injected bean property base on it
HttpServletResponse response = (HttpServletResponse) FacesContext.getCurrentInstance()
.getExternalContext().getResponse();
string serverName = request.getServerName();
response.sendRedirect(serverName+ "/home.jsf");
// also tried this
// facesContext.getExternalContext().redirect("/home.jsf");
return;
}
CustomLogin bean is session scoped and method "customLoginPage" is invoked postconstruct. So it is running in "RESTORE_VIEW" phase of JSF Lifecycle.
I am getting following error :
javax.faces.application.ViewExpiredException: viewId:/index.jsf - View /index.jsf could not be restored.
at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:205) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:116) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295) [jbossweb-7.4.8.Final-redhat-4.jar:7.4.8.Final-redhat-4]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.4.8.Final-redhat-4.jar:7.4.8.Final-redhat-4]
.
.
.
12:21:24,683 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/].[Faces Servlet]] (http-localhost/127.0.0.1:8080-1) JBWEB000236: Servlet.service() for servlet Faces Servlet threw exception: java.lang.IllegalStateException
at org.apache.catalina.connector.ResponseFacade.sendRedirect(ResponseFacade.java:420) [jbossweb-7.4.8.Final-redhat-4.jar:7.4.8.Final-redhat-4]
at com.sun.faces.context.ExternalContextImpl.redirect(ExternalContextImpl.java:602) [jsf-impl-2.1.28.redhat-3.jar:2.1.28.redhat-3]
at javax.faces.context.ExternalContextWrapper.redirect(ExternalContextWrapper.java:462) [jboss-jsf-api_2.1_spec-2.1.28.Final-redhat-1.jar:2.1.28.Final-redhat-1]
Few web.xml content that may be helpful
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
<context-param>
<param-name>javax.faces.PARTIAL_STATE_SAVING</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>javax.faces.RESOURCE_EXCLUDES</param-name>
<param-value>.xhtml .class .properties .xml</param-value>
</context-param>
<context-param>
<param-name>facelets.DEVELOPMENT</param-name>
<param-value>true</param-value>
</context-param>
<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>
I have read ViewExpiredException by BalusC. But here every request to user-portal is fresh. Plus when I change javax.faces.STATE_SAVING_METHOD to client, I am getting "GZIP exception".

Related

serving common html without facelets/jsf-tags

I have the folder containing a client-side-html-template ("template.xhtml"). The folder resides in public folder (not in WEB_INF).
When saved the file with suffix "xhtml" and wrap the content with "<ui:composition", then client side (ajax) request can access.
However, when I save it to "template.html" and delete the "<ui:composition", then client ajax cannnot access this page (401).
My web.xml has this mapping:
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.html</url-pattern>
</servlet-mapping>
<mime-mapping>
<extension>xhtml</extension>
<mime-type>text/html</mime-type>
</mime-mapping>
<security-constraint>
<display-name>Restrict raw XHTML Documents</display-name>
<web-resource-collection>
<web-resource-name>XHTML</web-resource-name>
<url-pattern>*.xhtml</url-pattern>
</web-resource-collection>
<auth-constraint />
</security-constraint>
How can I serve common "html-files" by client side ajax request without intercepting these files by jsf/facelets?
Found a simple way without the need to change web.xml:
I changed the static "html" files to "htm".

index.html change to index.xhtml

When trying to logout my application I'm having the following error message :
com.sun.faces.context.FacesFileNotFoundException: /index.xhtml Not Found in ExternalContext as a Resource
To logout I'm going though the following steps inside PhaseListener.beforePhase(PhaseEvent phaseEvent) :
// Redirect to index.html
NavigationHandler nh = fctx.getApplication().getNavigationHandler();
String action_outcome = "/index.html";
nh.handleNavigation(fctx, null, action_outcome);
My web.xml is as follow :
<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_3_0.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
id="WebApp_ID"
version="3.0">
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<filter-mapping>
<filter-name>Seam Filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>trinidad</filter-name>
<servlet-name>Faces Servlet</servlet-name>
<dispatcher>FORWARD</dispatcher>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.seam</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
<security-constraint>
<display-name>Restrict raw XHTML Documents</display-name>
<web-resource-collection>
<web-resource-name>XHTML</web-resource-name>
<url-pattern>*.xhtml</url-pattern>
</web-resource-collection>
<auth-constraint/>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
</login-config>
</web-app>
I do not have index.xhtml in my app, but I do have and want to keep it index.html file.
Why is my outcome_action given to NavigationHandler rename to index.xhtml ?
How could I avoid it ?
The NavigationHandler expects a JSF page, not a non-JSF page. Moreover, you're there actually not sending a real redirect at all, on the contrary to what the code comment says there. You're just performing a forward here.
Performing a real redirect would be the solution to your problem. It's to be done as below:
ExternalContext ec = FacesContext.getCurrentInstance().getExternalContext();
ec.redirect(ec.getRequestContextPath() + "/index.html");
See also:
What is the difference between redirect and navigation/forward and when to use what?
How to navigate in JSF? How to make URL reflect current page (and not previous one)
Unrelated to the concrete problem, doing authorization job in a phase listener stinks. Have you considered a servlet filter?
See also:
Limitations of using a PhaseListener instead of a Servlet Filter for authorization
Failing to redirect from JSF phaselistener
How to invalidate session in JSF 2.0?

A4J Polling throws error on reREnder

I have a JSF(2.2.5) project using RichFaces(4.3.6) and PrimeFaces (5.0) with the following code
<h:panelGroup>
<a4j:region>
<h:form>
<a4j:poll id="poll" interval="15000" enabled="#{card.poll}"
reRender="swimlanes #parent" actionListener="#{card.reloadData}" />
</h:form>
</a4j:region>
<h:form>
<a4j:outputPanel id="swimlanes">
<h:panelGroup>
Stuff
</h:panelGroup>
</a4j:outputPanel>
</h:form>
</h:panelGroup>
Which is very similar to the example of the RichFaces page but when the poll becomes enabled I get the following error and no reRendering occurs
debug[09:41:56.298]: New request added to queue. Queue requestGroupingId changed to j_idt20:poll
debug[09:41:56.299]: Queue will wait 0ms before submit
debug[09:41:56.299]: richfaces.queue: will submit request NOW
info [09:41:56.302]: Received 'begin' event from <span id=j_idt20:poll ...>
info [09:41:57.310]: Received 'beforedomupdate' event from <span id=j_idt20:poll ...>
debug[09:41:57.312]: Server returned responseText: <partial-response id="j_id1"><changes><update id="j_idt20:poll"><![CDATA[<span style="display:none;" id="j_idt20:poll"><script type="text/javascript">new RichFaces.ui.Poll("j_idt20:poll",{"enabled":true,"interval":15000,"ontimer":function(event){RichFaces.ajax("j_idt20:poll",event,{"incId":"1"} )}} )</script></span>]]></update><update id="javax.faces.ViewState"><![CDATA[zl8Yr/2cJTwlpFZfrKzxi16KSE/7HTOE5e3ptnUnBJgIouLrdwKWDtUDlUWXx3gmmcCA9jCPG6jpktimoa1GPe4Icqn0EC/f4uetGoNQqAoieOT+2vVVDmQPQclPxvnaZU/3T+2fUyMU2YU5YF0C6/WrStC+UGJzhts1AIP0v6tZ2PHC5XqZhb1hpg6943W4/61rQBNNMRDYerzyipmtFkNLLQm5VtyfVqijlaQhzeP1QJeOqTDHtFAnBN78Ie6E3uGgufi8wX9jVeIXkkaI29OERWotflx2OKaJSakb/lWXMMjjU4NTejwT6IOLx2Mw5mstciSUCRMPzAbA19OK7uFh+Zun2CPRG27T3RH9je9C7iVwxjlZNXKuUhW/QlyPWoyZkhCpfp5Xxc+eruD/iAUZSJPPKQaM/OzEukNegOSeSaQJ1dLCPynuKBhrRDVyAvdR1UN2jT3G4VtK3P8YCv9p8OpwiDQAl3hUqPPrWxgR/4oIsj7Znfjp5uYZ1FDKVEHJSIYpc2tZpYFqEXr9tGjN0lqKcgrFhf3uOJAPw3PM1xhD0iBwucVYQLdT3EgCzrGLfiirzWktFwBJ5Wlo+sJLKBl02rXhV65CCqWgi9FlpzhrCMkyav0nUpF1bkXJXI0Di3jKESQnF2lWbsNN5886Aem81pu5C8tXGzK4mulnM70oTcqrBuLKBjV6sXbctKATOYNytKIQC5JOH/kt0SqU/AlAg29mVjUkBtOyW/MNKXQ3xkRf4eLDxD0KmAGfNtWRzGYSd/YBbIPERZlrRJuhQh02NugTqvsXdMhKEZmbOSU9HYOX7vbj8UzDeZiy+Kp86ZAUswZ7jbOlZOVlOPn4AJPBD51htiUtTi4zh8zbhKSOpHfvuVYqseHBKtgDi0pvPn/rNC36dbtD4sLLxFPLLinr3OGpTj4IxJRhXQvV8Sj4jUuGK3y6s2eISOU6bgsmcz8ZqLO8OnZVakVITsyqQ9Zs7OhhCks/5a2VMaKpKDKMCS9bwt3aHlK+vPogE6IngBRXCB9ow8fC6A8eLSWQanQGS3U0cqiRt8LL25vs9bDuUTaXdHpJZjOU9KqzsafAeaBdxfAidxigtvvgaMissfobFc+j3yQBcAuMEX9s1NQT3R7xuMLe7Ox62qatAAm1eJgbjezI6W6ZYO6xjL7BEHzUswaBy51hw0Ff5HRfulZrnHlzogIqcLTg+uRsRqHlXIZ3cEOXBOvG6EJChyP7eAYvwuQAEBWUjtHbJ85s5xuZUsCDMwawVwN7i7J7ToLdVfuNiAfDkhzmx8M50lkXY0+5NBT/sIROuZ2nJd3QuPpQ2+nC0KoqA4+SjDKIHpC7hVeZVYXV1NmA1uTXVE5BTMnJid+CPSv93t5rbHAOowr6BTqJGv0uKHlFTaGt7kxlWdGZgT8rqP4/f5OtrgaW7oWjbRClEyUlOMxQt0HW2LcmILLS5Vc8xNUGqjCNxC7P4hbnR3OuIMMnsMyoXZCxj++ftsrXpNtqOAE6APZv6ph8E5I2KSmNe3BJiVqjYoybbLbrfbaLcAr5uR3y53BZDyHOukm/KWzk/EfNTed7wlLvOzZ6RFKWIqycF24sXNj/9OHHAsT3U8+lWnSy3O+dC+Yk49oL8CG6pLzL3weP68ztFnbI/FqgpyVocDPRs/gvySPWNqidGJqkqArnKglDa7DeX/uL/Lf+hcvNvge8fv87/FEll6amlKvIc84YEr2JWtUsgpmr4rB1L7/HvihIyCcmZT3VoBpqzuixsGWt48mZFAcMJVPzbWbVmPu8eUitCfq94rQGU5jq7DeDT131wUHnl/T3Ylpx5pd2hd0zDClN53MnaeyAoH9u+rYaU2ilkWWn0uq9Elt7VCU1MdIHu+RNb14JwnRQNCuPrXXW7Oaz8UlTO1RIODuDLLP6oVJP9YGa3qP6U9Kws9du4iJ9LYEt5DNeZvzJSRTTYrY=]]></update><extension id="org.richfaces.extension"><render>j_idt20:poll</render></extension></changes></partial-response>
warn [09:41:57.318]: richfaces.queue: ajax submit error: During update: javax.faces.ViewState not found
debug[09:41:57.319]: richfaces.queue: Nothing to submit
error[09:41:57.320]: Received 'error#malformedXML' event from <span id=j_idt20:poll ...>
error[09:41:57.321]: [status=200] During update: javax.faces.ViewState not found
info [09:41:57.321]: Received 'complete' event from <span id=j_idt20:poll ...>
This is the web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<display-name>Agile Development Tools</display-name>
<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>*.xhtml</url-pattern>
</servlet-mapping>
<context-param>
<description>State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2</description>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
<context-param>
<param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
<param-value>resources.application</param-value>
</context-param>
<context-param>
<param-name>javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL</param-name>
<param-value>true</param-value>
</context-param>
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
<welcome-file-list>
<welcome-file>index.xhtml</welcome-file>
</welcome-file-list>
</web-app>
Any idea how to fix this please?
It's a BUG in RichFaces 4.3.7 and earlier versions!
This Bug doesn't exist in RF Version 4.5 and 5.0

Tomahawk JSCookMenu does not trigger any actions after upgrading to JSF2

I've just migrated some medium-size web application from JSF 1.2/MyFaces to JSF 2.0/Mojarra. Apart from some custom components that I've implemented, everything seems to work, except for the JSCookMenu from Tomahawk (yes, I have Tomahawk which is a library from Apache, and still want to use Mojarra - but I understood there shouldn't be any big problem). I've replaced the myfaces-api.jar and myfaces-impl.jar with the corresponding jsf-api.jar and jsf-impl.jar, and took out from web.xml as many MyFaces parameters and filters as possible (some needed to remain because I still use Tomahawk). I have also upgraded Tomahawk to 1.1.11 for JSF2.
The application's JSCookMenu renders just fine, but doesn't trigger any action when clicking the menu items. I have some t:navigationMenuItem whose action attribute is bound to an outcome in faces-config.xml which should load a new view id, and yet some t:navigationMenuItem whose actionListener attribute is bound to a bean method (the Logout menu item, for example). Neither of them works, the actionListener code from my bean is not even called.
I'm not even sure how to investigate this, did anybody have a clue as to how can this be solved? I'm hoping something in web.xml can be of help.
The navigation cases are written correctly in the faces-config.xml, they used to work on JSF 1.2/MyFaces and also on JSF 2/MyFaces prior to the migration to Mojarra.
This is the relevant part of my web.xml file:
<servlet>
<servlet-name>faces</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>faces</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<context-param>
<param-name>com.sun.faces.allowTextChildren</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>javax.faces.FACELETS_RESOURCE_RESOLVER</param-name>
<param-value>com.avalanche.jsf.MyResourceResolver</param-value>
</context-param>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
<context-param>
<param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>facelets.DEVELOPMENT</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>facelets.RECREATE_VALUE_EXPRESSION_ON_BUILD_BEFORE_RESTORE</param-name>
<param-value>false</param-value>
</context-param>
<filter>
<filter-name>facesExtensionsFilter</filter-name>
<filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
<init-param>
<param-name>uploadMaxFileSize</param-name>
<param-value>1g</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>facesExtensionsFilter</filter-name>
<servlet-name>faces</servlet-name>
</filter-mapping>
<filter-mapping>
<filter-name>facesExtensionsFilter</filter-name>
<url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
</filter-mapping>

jsf2 xhtml pages not interpreted by browser [duplicate]

This question already has an answer here:
JSF returns blank/unparsed page with plain/raw XHTML/XML/EL source instead of rendered HTML output
(1 answer)
Closed 6 years ago.
I am testing the application "jsf-blank" from coreservlets site in order to understand how jsf works but my browser doesn't show the content of the xhtml page.
I use Tomcat 6 and Eclipse Indigo.
Have you any idea why the page is blank in my browser ?
Thank you for your help.
Thank you but it doesn't work with jsp directive and this is the content of my web.xml :
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
Last update :
I tried your solutions but I have the same problem, jsf tags aren't rendered by browser (I am a newbie in JSF).
My test is very simple :
web.xml :
<?xml version="1.0" encoding="UTF-8"?>
<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"
version="2.5">
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.xhtml</welcome-file>
</welcome-file-list>
index.xhtml :
<!DOCTYPE html>
<html lang="en"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head>
<title><h:outputText value="First JSF Application" /></title>
</h:head>
<h:body>
<h:outputText value="Test" />
</h:body>
</html>
Context name : jsf-blank
I test with url : http://localhost:8080/jsf-blank/index.xhtml
Result : blank page
Last update :
Thank you, my problem is solved, I think the origin of problem was rich-faces 3.3 jars in my tomcat's folder shared/lib.
I removed these jars and now it's working, do you know why it's a problem ?
That can happen when you have sent a request whose URL does not match the URL pattern of the FacesServlet which in turn causes that the JSF works won't run at all. According to the URL pattern of your servlet mapping, you have to request your XHTML page with .jsf extension. Imagine that you've an index.xhtml, then you'd need to invoke it by http://localhost:8080/contextname/index.jsf.
I however recommend to just replace the *.jsf URL pattern by *.xhtml so that you never need to worry about and fiddle with suffixes. Change your web.xml as follows:
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.xhtml</welcome-file>
</welcome-file-list>
And open the page by http://localhost:8080/contextname/index.xhtml.
Basically, MyFaces' JSF 2 implementation is returning blank pages whenever there's any error on either a configuration file or whatever. Worse yet, the errors aren't being sent to the log, either. Use Mojarra (Oracle's JSF 2 implementation) instead, and you'll start getting clear error messages.
RichFaces has it's own configs in web.xml (RichFaces Filter etc.), so if you don't want to use it, you should remove the library because you're not applying any suitable configuration for it, in order to trigger it properly.

Resources