JSF page as error-page location (WSAD 5.1)

I know that in the Core Java Server Faces book, there is an example of how to do this. They do it with f:subview with a note that the RI is buggy and f:view does not work.
In WSAD 5.1, neither subview or view works. Is anybody doing this with WSAD 5.1?
My current workaround is to have a servlet as the location, the servlet then forwards to the faces page, but this is less than ideal.

Here is a workaround for Error Handling with an Error Page.
http://www.jroller.com/page/mert?entry=handling_errors_with_an_errror

Similar Messages

  • Previous page in error page

    Hi
    How do I know the the page that throw exception in the error page?
    I used request.getHeader("Referer") but returns null.
    I there any other solution?
    Best regards
    Lu�s Matos

    Sorry, I just tested it and you are right (weird enough, the URL in the address bar remains the same as the requested URL, which means that there is no new request invoked and that's why I suggested you to use the request.getRequestURI()).
    After a little research I found out that you can use errorData for this.${pageContext.errorData.requestURI}Source: [http://www.onjava.com/pub/a/onjava/2003/12/03/JSP2part2.html]

  • Problem displaying error page of web.xml when using JSF, Ajax4jsf

    Hi,
    My application is using MyFaces, RichFaces and Ajax4jsf. When i try to display error page configured in web.xml, i am getting exception "Error while processing error page".
    my web.xml contents are as follows:
    <?xml version="1.0"?>
    <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <filter>
    <display-name>RichFaces Filter</display-name>
    <filter-name>richfaces</filter-name>
    <filter-class>org.ajax4jsf.Filter</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>richfaces</filter-name>
    <servlet-name>faces</servlet-name>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>FORWARD</dispatcher>
    <dispatcher>INCLUDE</dispatcher>
    </filter-mapping>
    <filter>
    <filter-name>extensionsFilter</filter-name>
    <filter-class>
    org.apache.myfaces.webapp.filter.ExtensionsFilter
    </filter-class>
    <init-param>
    <description>
    set the size limit for uploaded files. Format: 10 - 10 bytes 10k
    - 10 KB 10m - 10 MB 1g - 1 GB
    </description>
    <param-name>uploadMaxFileSize</param-name>
    <param-value>100m</param-value>
    </init-param>
    <init-param>
    <description>
    Set the threshold size - files below this limit are stored in
    memory, files above this limit are stored on disk.
    Format: 10 - 10 bytes 10k - 10 KB 10m - 10 MB 1g - 1 GB
    </description>
    <param-name>uploadThresholdSize</param-name>
    <param-value>100k</param-value>
    </init-param>
    </filter>
    <filter>
    <filter-name>Seam Redirect Filter</filter-name>
    <filter-class>org.jboss.seam.servlet.SeamRedirectFilter</filter-class>
    </filter>
    <filter>
    <filter-name>KTServletFilter</filter-name>
    <filter-class>com.kenexa.core.system.KTServletFilter</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>extensionsFilter</filter-name>
    <url-pattern>*.jsf</url-pattern>
    </filter-mapping>
    <filter-mapping>
    <filter-name>extensionsFilter</filter-name>
    <url-pattern>/faces/*</url-pattern>
    </filter-mapping>
    <filter-mapping>
    <filter-name>Seam Redirect Filter</filter-name>
    <url-pattern>*.jsf</url-pattern>
    </filter-mapping>
    <filter-mapping>
    <filter-name>KTServletFilter</filter-name>
    <url-pattern>*.jsf</url-pattern>
    </filter-mapping>
    <!-- seam Listeners -->
    <listener>
    <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
    </listener>
    <listener>
    <listener-class>com.kenexa.kr.web.KRServletListener</listener-class>
    </listener>
    <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>*.jsf</url-pattern>
    </servlet-mapping>
    <error-page>
    <exception-type>java.lang.Throwable</exception-type>
    <location>/rc/systemError.jsf</location>
    </error-page>
    </web-app>
    As per the configuration, when exception is thrown out of the application, container tries to display systemError.jsp page. If we want to include the JSF tags in systemError.jsp page, the request should pass through FacesServlet, so in the <error-page> <location> tag systemError page is specified with the extention systemError.jsf though it's actual extention is .jsp
    When exception is thrown from the application container invoke the error page but, while rendering systemError.jsf page exception is thrown saying "Exception processing error page "systemError.jsp" "
    To solve this problem i've gone through several forums, materials.
    In one forum a guy said, JSF1.1 spec has some problem in displaying error pages. To solve this don't write <f:view> tags in the error page, use <f:subview> intstead. By reading this, i again changed the contents of systemError.jsp page replacing <f:view> by <f:subview>. But the error is still repeating.
    Finally what i found is, when we use Ajax4jsf in the application, its AjaxViewRender class is throwing exception while rendering error pages configured through web.xml.
    So what i did is i changed error page extention from .jsf to .jsp in the <location> tag. Now jsf won't come in the picture and remove JSF related tags from the systemError.jsp page.
    <error-page>
    <exception-type>java.lang.Throwable</exception-type>
    <location>/rc/systemError.jsp</location>
    </error-page>
    Any comments are welcome----------------------------------------------------------------

    I too iam facing the same problem could you advise if you have found any solutions
              -Ram

  • Unable to show custom jsf error page !

    Hi all,
    I have a major problem displaying my custom errorpages. That is, they do not show at all!
    I also tried this in a simple project where I have only 1 jsf page, but the behaviour is the same.
    However, If I use a plain jsp page as erropage, then the error page is displayed as expected.
    My web.xml:
    <error-page>
    <error-code>404</error-code>
    <location>/jspErrorPage.jsp</location>
    </error-page>
    <!--error-page>
    <error-code>404</error-code>
    <location>/errorPage.jspx</location>
    </error-page-->
    If I remove all jsf and adf components from the adf-faces error page it does work correctly.
    For some reason the adf and jsf components can not be used in an error page.
    If I try this in the FOD demo application the behaviour is exactly the same !
    No errorpage is shown unless I remove all jsf and adf components.
    Luc
    Edited by: lucbors on Mar 6, 2009 11:28 AM

    hi Johan
    It looks like the filter-mapping/dispatcher element in web.xml is relevant here.
    Default the "adfFaces" filter seems to be mapped like this ...
    <filter-mapping>
      <filter-name>adfFaces</filter-name>
      <servlet-name>Faces Servlet</servlet-name>
      <dispatcher>FORWARD</dispatcher>
      <dispatcher>REQUEST</dispatcher>
    </filter-mapping>If I also add a dispatcher element with ERROR value like ...
      <dispatcher>ERROR</dispatcher>... the behaviour of my application starts to change.
    With such a dispatcher element configured, I can get an error-page configuration like this to "work":
         <error-page>
              <error-code>500</error-code>
              <location>/faces/internalServerErrorFaces.jspx</location>
         </error-page>Using JDeveloper 10.1.3.4.0 I created an example application for this,
    see http://verveja.footsteps.be/~verveja/files/oracle/FacesErrorPageApp-v0.01.zip
    The screenshots in FacesErrorPageApp.png show the page with the buttons that cause exceptions and the error page I get.
    The thing is, this seems to work only te first time (for the first session). So, navigating back and clicking another button only shows the same page again and not the error page.
    If I try something similar in a web-module that does not use ADF Faces, things seem to be OK.
    (The example application has a ViewControllerNoADFFaces project with an errorButtonPageNoADFFaces.jspx page with buttons that will cause an exception and show the internalServerErrorNoADFFaces.jspx page. From that error page I can navigate back an click a different button to cause a different exception to end up on the error page again.)
    Given that this at least looks like an ADF Faces issue, I think a reply from someone from Oracle in this forum thread could be useful. (And you could always create a service request on metalink.oracle.com for this.)
    regards
    Jan Vervecken

  • How to handle error pages in JSF

    Hii,
    I am facing problem in JSF handling server side errors like faces exception.
    For Ex; if i have a JSF screen,if i enter invalid data it will show error in the same page if i use messages tag,but i need to display errors in another page like error pages.
    i tried to do as we do in JSP,but facesServlet is not supporting.
    i am very thankful if anyone can help.

    How about asking in the JSF forum where the experts are?

  • JSP error page does not displayed on its own, includes in the original JSP

    Problem Description: - Exceptions in a Condition cause pages to fail to render.
    The actual issue is, the JSP error page does not displayed on its own, included in the original JSP Page when exception occurs.
    Problem Cause: As per the JSP specification when jsp content reached the buffer size (default 8KB) the page being flushed (Part of condent displays). The default �autoFlush� value is true.
    When the page buffer value is default size (8KB), and if any exception occurs after flushing the part of the content, instead of redirecting into error page, the error page content included in the original page.
    If i specify autoFlush="false" and with default buffer size, at the runtime if the buffer size is reached, i am getting stackoverflow error.
    To solve the above problem we can make it autoFlush=�false� and buffer=�100KB�. But we can�t predict the actual size of the page.
    I found in one of the weblogic forum as no solution for this issue. Ref.
    http://support.bea.com/application?namespace=askbea&origin=ask_bea_answer.jsp&event=link.view_answer_page_clfydoc&answerpage=solution&page=wls/S-10309.htm
    Please provide me any solution to resolve the problem.

    Error-Page tags work best with an error.html pages. If you have an error.jsp page what I would do, and I have, is wrap my classes and jsp pages in a try catch block where you forward to the error jsp page and display anything you want. YOu can also do this with if else statements. I have used the tomcat error pages before but when I've implemented them I used java.lang.Exception as the error to catch not Throwable. I don't know if this would make a difference or have anything to do with your problem.

  • J_security_check - custom error page

    Hi all,
    I've successfully run jazndemo - callerInfo sample from
    Oracle 9iAS and OC4J - version 9.0.3
    I then modified web.xml to use FORM-based auth,
    instead of BASIC auth.
    I utilize j_security_check for this purpose.
    FYI:
    - I use JAZNUserManager with XML (jazn-data.xml)
    - My browser is IE ver 5.0
    - I use OC4J 9.0.3.0.0
    This is the excerpt of my web.xml:
    <login-config>
    <auth-method>FORM</auth-method>
    <form-login-config>
    <form-login-page>login.html</form-login-page>
    <form-error-page>error.html</form-error-page>
    </form-login-config>
    </login-config>
    It does run properly when I supplied correct userId and
    correct password, BUT if I supplied wrong UserId and/or
    password, OC4J ALWAYS display generic 403 (Forbidden) page !!
    Is it a bug?? It should display error.html instead.
    Please give me a hand on this, this thing really
    frustrate me..
    Any pointer would be a great help,
    Thanks in advance,
    --fadly

    After I re-read the post to make some sense out of it I have to add
    I have already added the drop down but how can I retrieve what is being selected after user presses login button

  • Error Page

    Hi,
    When I click on a responsibility it is showning an error page.
    Error Page
    You have encountered an unexpected error. Please contact the System Administrator for assistance.
    Can anyone plz help me?
    Neeraj.

    No I dont get an error for all responsibilities.
    I have turned the FND:Diagnostics to YES and got a lot of things ... butt i dunno wat to look for exactly.
    Here is what I got when I searched for "exception"
    java.sql.SQLException: ORA-20001: HXC_NO_HIER_FOR_DATE ORA-06512: at "APPS.HR_UTILITY", line 709 ORA-06512: at "APPS.HXC_PREFERENCE_EVALUATION", line 1220 ORA-06512: at "APPS.HXC_TIMECARD_PROPERTIES", line 354 ORA-06512: at line 2 at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134) at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289) at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:589) at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1972) at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch
    Please Help.
    Neeraj

  • FORM based login form-error-page

    Hi,
    I have activated FORM based login for EM (oracle 9iAS on Solaris). So, in web.xml for EMD, I have
    <login-config>
    <auth-method>FORM</auth-method>
    <form-login-config>
    <form-login-page>/jsp/login.jsp</form-login-page>
    <form-error-page>/error/oc4j_error.html</form-error-page>
    </form-login-config>
    </login-config>
    When I login as ias_admin, everything seems fine. However, when I login as any other user (not in ias_admin role), the browser redirects to /emd/console/ias/applicationServer...
    Why is the container not redirecting to /emd/error/oc4j_error.html ?
    Any input will be truly appreciated. Hopefully I am doing something wrong.
    Thanks,
    Krishnendu

    Hi Frank,
    Thanks for your reply. If I have a error page in the FORM login, then the container (according to j2ee specs) should redirect to /emd/oc4j_error.html if I authenticate as a user without administrator privileges.
    <login-config>
    <auth-method>FORM</auth-method>
    <form-login-config>
    <form-login-page>/jsp/login.jsp</form-login-page>
    <form-error-page>/oc4j_error.html</form-error-page>
    </form-login-config>
    </login-config>
    For all other containers (WAS, WebLogic and Sun Application server, Tomcat), it seems to work fine.
    Thanks,
    Krishnendu

  • How to display exception on error page raised from custom login module?

    Hi All,
    I've created my own login module and I am using form authentication mechanism.
    Here is how my login and error pages defined in web.xml:
        <login-config>
          <auth-method>FORM</auth-method>
          <form-login-config>
            <form-login-page>/logon.jsp</form-login-page>
            <form-error-page>/error.jsp</form-error-page>
          </form-login-config>
        </login-config>
    But when my login module throws an exception (LoginException) the following code in <i>error.jsp</i> returns null:
    <%=request.getAttribute("javax.servlet.error.message")%>
    though this code works good on Weblogic.
    Declaring the <i>error.jsp</i> also in the <error-page> tag didn't help.
    So what did I miss to configure?
    Or maybe NetWeaver doesn't allow to get the exception from the <form-error-page> at all?

    If I understand your question correctly, you can use the CQ.Notification JavaScript object for this. See documentation here: http://dev.day.com/docs/en/cq/current/widgets-api/index.html?class=CQ.Notification

  • Custom error Page when Run time Occurs in SharePoint

    Hi Guys In my SharePoint application in case if any Run time error occurs in my code, It should not come Server error \ ..instead it needs to redirect to Custom error Page But its not working Can you plz help out? I made changes in web.Config file but its
    not working..Can you guys plz help me out how to redirect to custom error Page if any run time error occurs in Sharepoint??
       <customErrors mode="RemoteOnly" defaultRedirect="~/GeneralError.htm" redirectMode="ResponseRedirect"></customErrors>
     [[ Web.config file in Virtual Directory C:/inetpub/wwwroot/vd/port/web.config
    Is there any changes in addition to this web.config file??
    Reddy

    Hi Reddy,
    Here you go. pls follow the tutorials
    http://www.fixthisbug.com/post/creating-a-custom-error-page-for-sharepoint-2010-web-application
    http://blog.incworx.com/blog/sharepoint-tips-and-tricks/implementing-sharepoint-2010-custom-error-pages-v3
    http://www.spdeveloper.co.in/articles/pages/custom-error-pages-for-sharepoint2010-sites.aspx
    Please remember to click 'Mark as Answer' on the answer if it helps you

  • JSF tags are not rendered in error page

    I have configured error page for HTTP 404 error in web.xml like this
    <error-page>
    <error-code>404</error-code>
    <location>/Common/error.jspx</location>
    </error-page>
    Faces Servlet is configured as follows
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    My error page (error.jspx) looks like this
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html" xmlns:trh="http://myfaces.apache.org/trinidad/html"
    xmlns:tr="http://myfaces.apache.org/trinidad" xmlns:c="http://java.sun.com/jsp/jstl/core">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <html>
    <head>
    <title>Error Page</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    </head>
    <body id="b1">
    <h4 style="color:red">An Error Occured. Please click Back button or Signout.</h4>
    <input type="button" value="Back" onclick="history.back()"/>
    <tr:commandButton id="cb1" text="SIGN OUT" action="exit" actionListener="#{Login.LogOut}"/>
    </body>
    </html>
    </jsp:root>
    When I deploy application and run into 404 error, page displays error message with only Back button. I don't see SingOut button. I have checked url and it follows /faces/* pattern. Still to double check, I made a change and configured servlet mapping in web.xml as
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
    <url-pattern>*.jspx</url-pattern>
    </servlet-mapping>
    Still commandButton is not rendered. I understand that my error page don't have access to FacesContext or not going through Faces Servlet. I know this is a small issue, but couldn't figure out what can be done. I have also tried using .xhtml and .jsf as per googled suggestion. But no luck
    I have tried different solutions to my problem and googled for solutions. But I couldn't get it resolved.
    So can you please provide any suggestions...
    Edited by: user1818355 on May 22, 2013 2:29 PM

    I think my faces servlet is configured to handle URLs having /faces/* pattern. I don't have any folder named with faces but I can access all my web pages which have /faces/ in their url. All jspx pages in application are configured in task flows. So I think they have access in FacesContext. But error page is configured in only web.xml and some how it is missing access to FacesContext and not rendering JSF tags. Any help?

  • Is it possible to use JSF file as as error page.

    I am using jsf file as an error page.It is working in fine in websphere. But if i am using that only the exception is raised it is not going to error page.
    In Web.XML file,
    <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>/faces/*</url-pattern>
    </servlet-mapping>
    <error-page>
    <error-code>403</error-code>          <location>/faces/unauthorized.jsp</location>
    </error-page>
    jsf codings are placed under *.jsp files. In the time submitting form data to server a method throws NumberFormatException. This exception information is displayed in console. but blankpage is coming . It is not redirected to error.jsp fle which is under faces/error.jsp.
    If i am directly giving /error.jsp then it is giving Faces context is not created error.
    So i tried use simple jsp(pure jsp) file wihtin the folder and i set path like /pages/foo.jsp. It is working.
    Tell me is it possible to use jsf as error page.

    What would you hope to do with the reference?  The Mathscript node doesn't have a file reading capability.  You need to read the file and pass the data into the Mathscript node.
    EDIT: I stand corrected.  You need to use the fopen and fclose functions inside of the MathScript node to be able to read a file inside of it.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • JDev 1013, Webservice as Data Control in JSF page returns error

    Hello,
    For a client we are starting a project with Java Server Faces in combination with web services. In order to do some testing we created a web service in PLSQL (with a empno input field and a record output) and deployed this web service on an OC4J container. We then created a (new) JSF project, used the PLSQL web service as a Data Source, and used this Data Source in a JSF page.
    When this JSF page is started an error occurs validation -
    DCA-40007: The value for parameter "empNo" cannot be null..
    The webservice can however be called in the page, the output is shown but the error stays in the page.
    Communication with support gave me a temporary solution
    I've put in the page definition for both the methodIterator (getEmpIter) and the accessIterator (ReturnIterator) the Refresh="Deferred". Now the error doesn't show in the page at startup of the page. Data is presented correctly after pushing the button, though still in the Jdeveloper Embedded OC4J Server Log shows a list of
    ERROR Value for parameter : 'empNo' cannot be null.
    In a multi row Webservice (created by JDeveloper) however i still get this error.
    (1) What caused this error?
    (2) When is the next version of JDeveloper due?
    (3) I am looking for documentation on the following subjects
    (3.1) How a JSF page is rendered by the Oracle JSF implementation
    (3.2) How to read and adjust the JSF page definition, for example the <executables> part
    (3.3) Problem with the extra abstraction layer is that is very hard to find where an error occurs. Is a mechanism/documentation available to find in which JSF fase an error occurs and how to bypass it?
    Regards Leon Smiers

    (1) I think what is happening is that your page calls out to the Web service when you first run it without any parameter. This is why you get the error and also the reason that deffer works to solve this.
    I think a solution would be to have your Web service handle the case of receiving an empty parameter.
    (2) When it is ready :-)
    (3.2) right click the jsf page and choose "go to page defenition" you can then edit it using the structure pane and the property inspector.
    (3.3) you can run in debug mode, the code for ADF will be available when we go production, and with it a lot of more documentation.

  • Custom Error Pages (404 & 500) not invoked (JSF 1.2 & Websphere 6.0.1)

    Hopefully this is very obvious to some of the experts here. I'm trying to have my custom error pages (404 & 500) displayed, but in stead I get the normal system output text (ugly). The web.xml has been configured to apply the FacesServlet to all pages ending with "jspx". What I now get is the following: Whenever a page ending with .jspx cannot be found, the custom 404 page is IGNORED, however, when I don't use .jspx, but .jsp for example, IT WORKS. Below is my web.xml. I have already tried to make the error pages plain html, and also moved them to the root directory, no luck.
    Oh yes, running on RAD 6.0.1, Faces 1.2.
    Please if someone could guide me here...
    ########## SNIP ##########
    <servlet id="Servlet_1212573625706">
    <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>JS Resource Servlet</servlet-name>
    <url-pattern>/.ibmjsfres/*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.jspx</url-pattern>
    </servlet-mapping>
    <error-page>
    <error-code>500</error-code>
    <location>/includes/errorPages/error500.jspx</location>
    </error-page>
    <error-page>
    <error-code>404</error-code>
    <location>/includes/errorPages/error404.jspx</location>
    </error-page>
    ########## SNIP ##########

    I recognize this as an appserver bug (yeah, it's Websphere).
    Websphere (and the older versions of Apache Tomcat where it is actually based on) doesn't expect the error-page to be a dynamic servlet-served page, but as a static page. It roughly handles as follows: get the error-page location from web.xml, test its existence on the disk file system, if positive then go ahead, but if negative then display default error screen.
    The file with .jspx extension does not physically exist on the disk file system. A workaround for which I remember it worked in WAS 5.x is to create physically that file (empty content is allowed) on the disk file system. So create a blank file with jspx extension at the same location.

Maybe you are looking for