Win a copy of Terraform in Action this week in the Cloud forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Filter Error Page

 
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using a login filter with Facelets and JSF 2.0 that is giving me a blank page when an error is generated by business logic. When I take the filter off, the error page is shown properly. It is happening on a request (rather than a forward). It worked in JSF 1.2 with JSPs. Any ideas what I might be doing wrong?

Here's the filter mapping from my web.xml.




Here's my error-page definitions in my web.xml:



My actual error page is called /pages/error.xhtml. The error is happening on a call to chain.doFilter() in the Filter. Is there a good way to see what page the filter might be trying to load on the error? Any other tips to debug?


 
Saloon Keeper
Posts: 24575
168
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Depending on the server, attempts to generate JSF-based error pages may not work. In order for JSF to behave properly, you have to route a URL through the FacesServlet, and the container may not be fully simulating this process when it dispatches the error page. For best results, keep pages referenced from web.xml as straight JSP or HTML files. They can forward to JSF, if the situation permits it.
 
Andy Holm
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried using a JSP page for my error page but got the same blank page when the business logic threw an error and the login filter was turned on. Any other ideas to try? I am using Apache Tomcat 6 if that matters.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic