Web Dispatcher error pages internationalization

Hello,
I need to show web dispatcher custom error pages in the language of the user making the request. I can get the translated text I just need to know how to dynamically include these translated pages in the custom error pages.
Web dispatcher is configured for custom error pages and works correctly. Now we're looking to see how to include translated pages in the user's language. Is there a way to get the language from the browser headers that are sent?
Thanks,
John

Hi John,
You can use javascript to determine the language set on the browser of the user and redirect to a translated page based on the language.
Here is a simple sample code of how to get the language from the browser:
http://www.java2s.com/Code/JavaScript/Javascript-Objects/GetbrowserLanguage.htm
You then can redirect using javascript to the page you want based on it.
Hope it helps,
Roy
Edited by: Roy Cohen on Nov 19, 2009 6:46 PM

Similar Messages

  • Modidy the Web Dispatcher Error message

    Hi,
    Where do we modify the web dispatcher error message "500 Dispatching error" to a cutome message on the J2EE?
    Thank you.

    note says:
    Customization of 500 Internal Server Error
    This response code is returned when there is a problem with the application or the server. Any not handled Exception or Error triggers the return of response with code 500.
    To return different content on error occurance, you need to handle the error by inserting the appropriate declaration in web.xml.
    Sample declaration for handling of test.MyApplicationException occurances in the application scope:
      <error-page>
        <exception-type>test.MyApplicationException< /exception-type>
        <location>/customerrors/MyApplicationException.jsp</location>
      </error-page>
               Note1: For each error condition you need to handle (application exception use a separate error page. For all other exceptions use a global error handling definition for java.lang.Throwable.
    However you must be aware of the following:
    In case java.lang.OutOfMemoryError appears the subsequent behaviour of the JVM is undefined and this may lead to unpredicatable effects. Therefore the webcontainer will not pass such error to the error page for handling.
    If the following general definition
      <error-page>
        <exception-type>java.lang.Throwable< /exception-type>
        <location>/customerrors/WhateverProblem.jsp</location>
      </error-page>
    is in place, then the error handler resource is responsible for logging the error condition.
    This means the resource handling general problems if such is declared must be dynamic (a JSP page or a servlet not HTML page)
               Note2: Exceptions are searched in order of appearance in web. xml and not determining closest in class hierarchy.
               This is true for all patchlevels of J2EE Engine 6.20 and versions of J2EE Engine 6.40 lower than SP11.
    Therefore if test.ChildException extends test.ParentException extends java.lang.Exception and
    <error-page>
       <exception-type>test.ParentException</exception-type>
      <location>/customerrors/ParentException.jsp</location>
    </error-page>
    <error-page>
      <exception-type>test.ChildException</exception-type>
      <location>/customerrors/ChildException.jsp</location>
    </error-page>
    is specified in the web.xml of the application as exceptions are searched in order of appearance regardless if ChildException or ParentException is thrown, the call will be directed to /Customerrors/ParentException.jsp because ChildException is a subclass of ParentException..
    Working mapping would be :
    <error-page>
      <exception-type>test.ChildException</exception-type>
      <location>/customerrors/ChildException.jsp</location>
    </error-page>
    <error-page>
      <exception-type>test.ParentException</exception-type>
      <location>/customerrors/ParentException.jsp</location>
    </error-page>
    so you need to switch the declarations in the web.xml (effective on next start of the application).
    BR, Oliver

  • Display error page using web.xml error-page

    I need to dispaly error page when IOException in thrown. How to do that with web.xml error-page tag?
    start.jsf
    public String doButton1Action() throws IOException{
              String value = getText1().getValue().toString();
              try {
                   File f = new File(value);          
                   InputStream in = new FileInputStream(f);
              } catch (IOException e) {
                   throw new IOException();
              return "success";
         }I have this in web.xml:
         <error-page>
              <exception-type>java.io.IOException</exception-type>
              <location>/ioerror.jsp</location>
         </error-page>

    I tried that earlier but then I get error just printed to console and HTTP 500 - Internal server error -page, bubt not my errorPage.
    [26.1.2007 21:19:16:543 EET] 00000038 jsf           E com.sun.faces.lifecycle.InvokeApplicationPhase execute #{pc_Start.doButton1Action}: javax.faces.el.EvaluationException: java.io.FileNotFoundException: c:\temp\ghostfile.jpg
                                     javax.faces.FacesException: #{pc_Start.doButton1Action}: javax.faces.el.EvaluationException: java.io.FileNotFoundException: c:\temp\ghostfile.jpg
         at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:79)
         at javax.faces.component.UICommand.broadcast(UICommand.java:312)
         at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:298)
         at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:412)
         at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:77)
         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:220)
         at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:91)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
         at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966)
         at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
         at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)
         at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:92)
         at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:744)
         at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1433)
         at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:93)
         at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465)
         at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:394)
         at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102)
         at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:152)
         at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:213)
         at com.ibm.io.async.AbstractAsyncFuture.fireCompletionActions(AbstractAsyncFuture.java:195)
         at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
         at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:194)
         at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:741)
         at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:863)
         at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1510)
    Caused by: javax.faces.el.EvaluationException: java.io.FileNotFoundException: c:\temp\ghostfile.jpg
         at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:131)
         at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:73)
         ... 25 more

  • Error-page in web.xml: error page doesn't show

    Hi,
    I added the following block in web.xml file:
    <error-page>
    <exception-type>java.lang.Exception</exception-type>
    <location>/ESU9098J.jsp</location>
    </error-page>
    When I force an exception, I get a pop-up for downloading a file named EAC0002Se04379bf (where EAC0002S is the name of the servlet in which the exception happens). Can anybody help?
    I use OC4J 10221 on Win Xp with JDK 1.3.1
    Thanks
    Jean

    This is due to a erroneous MIME type mapping in one of the OC4J config files.
    To resolve it:
    Modify mime.types under $OC4J_HOME/config by removing the line application/jsp (for some unknown reason, there are two of them in the file) or renaming the
    word jsp into some other name, ex.:
    "application/jsp jsptemp"
    for both the 2 lines. Then add "jsp" to the end of the "text/html" line, ex.:
    "text/html html htm jsp".
    This will make oc4j use text/html in the response when a jsp file is being processed that's why it's very important to eliminate application/jsp by renaming jsp or simply deleting the line.
    We fixed this error in the config file in a later release.
    cheers
    -steve-

  • Web dispatcher "Error : PSE file ,unable to use! "

    Hello,
    I has a SAP Netweaver kernel 7.01 with oracle database.
    I tried to config web dispatcher to support ssl by following the link below.
    [http://help.sap.com/saphelp_nw04s/helpdata/en/39/09a63d7af20450e10000000a114084/content.htm]
    I has done all step successfully.
    But when I started web dispatcher I got these error in the log file.
    [Thr 8688]   profile param "ssl/server_pse" = "E:\webdispatcher\sec\SAPSSL.pse"
               resulting Filename = "E:\webdispatcher\sec\SAPSSL.pse"
    [Thr 8688] *** ERROR =>   secudessl_Create_SSL_CTX():  PSE "E:\webdispatcher\sec\SAPSSL.pse": unable to use! [ssslsecu.c   1735]
    [Thr 8688] secudessl_Create_SSL_CTX: SSL_CTX_set_default_pse_by_name() failed --
      secude_error 1824 (0x00000720) = "Wrong or Missing PIN for PSE"
    [Thr 8688] >> ---------- Begin of Secude-SSL Errorstack ---------- >>
    [Thr 8688] ERROR in SSL_CTX_set_default_pse_by_name: (1824/0x0720) Wrong or Missing PIN for PSE : "E:\webdispatcher\sec\SAPSSL.pse"
    ERROR in ssl_set_pse: (1824/0x0720) Wrong or Missing PIN for PSE : "E:\webdispatcher\sec\SAPSSL.pse"
    ERROR in af_open: (1824/0x0720) Wrong or Missing PIN for PSE : "E:\webdispatcher\sec\SAPSSL.pse"
    ERROR in secsw_open: (1824/0x0720) Wrong or Missing PIN for PSE : "E:\webdispatcher\sec\SAPSSL.pse"
    ERROR in sec_parse_PSEInfo_cont: (1824/0x0720) Wrong or Missing PIN for PSE : "E:\webdispatcher\sec\SAPSSL.pse"
    [Thr 8688] << ---------- End of Secude-SSL Errorstack ----------
    [Thr 8688] *** ERROR => SapISSLAddCredential(): Error SSSLERR_PSE_ERROR trying to create SERVER Credential
            for "E:\webdispatcher\sec\SAPSSL.pse" [ssslxxi.c    2324]
    [Thr 8688] *** ERROR => Initialization of SSL library failed -- NO SSL available!
    [Thr 8688] =================================================
    I search the forum but didn't see "file pse unable to use!" issue.
    Is this about wrong certificate when import cer to PSE file or something else?
    Any help will be appriciate.
    Thank you
    Chai

    Hi,
    I am facing same issue.
    Please revet, if you resolved the same.
    pasting log here.
    Response will be appreciated.
    trc file: "dev_webdisp", trc level: 1, release: "720"
    sysno 00
    sid WD1
    systemid 390 (AMD/Intel x86_64 with Linux)
    relno 7200
    patchlevel 0
    patchno 68
    intno 20020600
    make multithreaded, ASCII, 64 bit, optimized
    profile /usr/sap/WD1/SYS/profile/WD1_W00_sapportal
    pid 4382
    [Thr 140272010733408] Fri Nov 1 11:41:50 2013
    [Thr 140272010733408] started security log to file ./dev_icm_sec
    [Thr 140272010733408] SigISetDefaultAction : default handling for signal SIGCHLD
    [Thr 140272010733408] SAP Web Dispatcher running on: sapportal.abrajoman.com
    [Thr 140272010733408] MtxInit: 30001 0 2
    [Thr 140272010733408] ***LOG IM1=> IcmInit, Startup (SAP Web Dispatcher&sapportal.abrajoman.com&4382&) [icxxrout_mt. 1914]
    [Thr 140272010733408] IcmInit: listening to admin port: 65000
    [Thr 140272010733408] MPI: dynamic quotas disabled.
    [Thr 140272010733408] MPI init: pipes=4000 buffers=1279 reserved=383 quota=10%
    [Thr 140272010733408] CCMS: AlInitGlobals : alert/use_sema_lock = TRUE.
    [Thr 140272010733408] CCMS: Initalized shared memory of size 40000000 for monitoring segment.
    [Thr 140272010733408] CCMS: Checking Downtime Configuration of Monitoring Segment.
    [Thr 140272010733408] IcrCoreInitSessionTable: Session table initialized
    [Thr 140271863756544] HttpExtractArchive: files from archive /usr/sap/WD1/SYS/exe/run/wdispadmin.SAR in directory /usr/sap/WD1/W00/data/icmandir are up to date
    [Thr 140271863756544] HttpISubHandlerAdd: Added handler HttpAdminHandler(0x7f9390000e70), slot=0, flags=36869) for /sap/admin, active: 1, table 0x7f9390000a10
    [Thr 140271863756544] HttpISubHandlerAdd: Added handler HttpModHandler(0x7f93900012e0), slot=1, flags=12293) for /, active: 1, table 0x7f9390000a10
    [Thr 140271863756544] CsiInit(): Initializing the Content Scan Interface
    [Thr 140271863756544] AMD/Intel x86_64 with Linux (mt,ascii,SAP_CHAR/size_t/void* = 8/64/64)
    [Thr 140271863756544] CsiInit(): CSA_LIB = "/usr/sap/WD1/SYS/exe/run/libsapcsa.so"
    [Thr 140271863756544] HttpISubHandlerAdd: Added handler HttpAuthHandler(0x7f9390001440), slot=2, flags=12293) for /, active: 1, table 0x7f9390000a10
    [Thr 140271863756544] HttpISubHandlerAdd: Added handler HttpWebDispHandler(0x7f9390008340), slot=3, flags=1060869) for /, active: 1, table 0x7f9390000a10
    [Thr 140271863756544] Started service PORT=8100,PROT=HTTP,TIMEOUT=60,PROCTIMEOUT=60
    [Thr 140271863756544] =================================================
    [Thr 140271863756544] = SSL Initialization platform tag=(linuxx86_64_gcc41)
    [Thr 140271863756544] = (720_REL,Oct 15 2010,mt,ascii,SAP_UC/size_t/void* = 8/64/64)
    [Thr 140271863756544] profile param "ssl/ssl_lib" = "/usr/sap/WD1/exe/libsapcrypto.so"
    [Thr 140271863756544] resulting Filename = "/usr/sap/WD1/exe/libsapcrypto.so"
    [Thr 140271863756544] = found SAPCRYPTOLIB 5.5.5C pl36 (Jul 3 2013) MT,AESNI,NB
    [Thr 140271863756544] = current UserID: "wd1adm", env-var USER="wd1adm"
    [Thr 140271863756544] = using SECUDIR=/usr/sap/WD1/W00/sec
    [Thr 140271863756544] profile param "ssl/server_pse" = "/usr/sap/WD1/W00/sec/epssl.pse"
    [Thr 140271863756544] resulting Filename = "/usr/sap/WD1/W00/sec/epssl.pse"
    [Thr 140271863756544] *** ERROR => secudessl_Create_SSL_CTX(): PSE "/usr/sap/WD1/W00/sec/epssl.pse": unable to use! [ssslsecu_mt. 1735]
    [Thr 140271863756544] secudessl_Create_SSL_CTX: SSL_CTX_set_default_pse_by_name() failed --
    [Thr 140271863756544] secude_error 1824 (0x00000720) = "Wrong or Missing PIN for PSE"
    [Thr 140271863756544] >> ---------- Begin of Secude-SSL Errorstack ---------- >>
    [Thr 140271863756544] ERROR in SSL_CTX_set_default_pse_by_name: (1824/0x0720) Wrong or Missing PIN for PSE : "/usr/sap/WD1/W00/sec/epssl.pse"
    [Thr 140271863756544] ERROR in ssl_set_pse: (1824/0x0720) Wrong or Missing PIN for PSE : "/usr/sap/WD1/W00/sec/epssl.pse"
    [Thr 140271863756544] ERROR in af_open: (1824/0x0720) Wrong or Missing PIN for PSE : "/usr/sap/WD1/W00/sec/epssl.pse"
    [Thr 140271863756544] ERROR in secsw_open: (1824/0x0720) Wrong or Missing PIN for PSE : "/usr/sap/WD1/W00/sec/epssl.pse"
    [Thr 140271863756544] ERROR in sec_parse_PSEInfo_cont: (1824/0x0720) Wrong or Missing PIN for PSE : "/usr/sap/WD1/W00/sec/epssl.pse"
    [Thr 140271863756544] << ---------- End of Secude-SSL Errorstack ----------
    [Thr 140271863756544] *** ERROR => SapISSLAddCredential(): Error SSSLERR_PSE_ERROR trying to create SERVER Credential
    for "/usr/sap/WD1/W00/sec/epssl.pse" [ssslxxi_mt.c 2324]
    [Thr 140271863756544] *** ERROR => Initialization of SSL library failed -- NO SSL available!
    [Thr 140271863756544] =================================================
    [Thr 140271863756544]
    [Thr 140271863756544] <<- ERROR: SapSSLInit(read_profile=1)==SSSLERR_PSE_ERROR
    [Thr 140271863756544] *** ERROR => IcmServInitSSL: SapSSLInit (rc=-40): SSSLERR_PSE_ERROR [icxxserv_mt. 251]
    [Thr 140271863756544] *** WARNING => Could not start service (rc=-14) PORT=8300,PROT=HTTPS,TIMEOUT=60,PROCTIMEOUT=900,VCLIENT=0 [icxxserv_mt. 651]
    [Thr 140272010733408] SigISetDefaultAction : default handling for signal SIGCHLD
    [Thr 140272010733408] IcmCreateWorkerThreads: created worker thread 0
    [Thr 140272010733408] IcmCreateWorkerThreads: created worker thread 1
    [Thr 140272010733408] IcmCreateWorkerThreads: created worker thread 2
    [Thr 140272010733408] IcmCreateWorkerThreads: created worker thread 3
    [Thr 140272010733408] IcmCreateWorkerThreads: created worker thread 4
    [Thr 140272010733408] IcmCreateWorkerThreads: created worker thread 5
    [Thr 140272010733408] IcmCreateWorkerThreads: created worker thread 6
    [Thr 140272010733408] IcmCreateWorkerThreads: created worker thread 7
    [Thr 140272010733408] IcmCreateWorkerThreads: created worker thread 8
    [Thr 140272010733408] IcmCreateWorkerThreads: created worker thread 9
    [Thr 140271863756544] IcmWatchDogThread: watchdog started
    [Thr 140271847081728] Fri Nov 1 11:42:57 2013
    [Thr 140271847081728] *** ERROR => NULL bytes in HTTP request {0005000c} [http_plgrt_mt.c 6025]
    [Thr 140271847081728] CONNECTION (id=5/12):
    used: 1, type: default, role: Server(1), stateful: 0
    NI_HDL: 59, protocol: HTTP(1)
    local host: 192.168.22.2:8100 ()
    remote host: 192.168.2.8:56650 ()
    status: READ_REQUEST
    connect time: 01.11.2013 11:42:57
    MPI request: <c> MPI response: <d>
    request_buf_size: 65464 response_buf_size: 0
    request_buf_used: 122 response_buf_used: 0
    request_buf_offset: 0 response_buf_offset: 0
    [Thr 140271847081728] Address Offset REQUEST:
    [Thr 140271847081728] ------------------------------------------------------------------------
    [Thr 140271847081728] 0x7f9399f8d068 000000 16030100 75010000 71030152 73499529 |....u...q..RsI.)|
    [Thr 140271847081728] 0x7f9399f8d078 000016 9f988ed3 cb861e2f 7260cac7 978a9a30 |......./r`.....0|
    [Thr 140271847081728] 0x7f9399f8d088 000032 b74f3103 f3feea03 2b336a00 0018002f |.O1.....+3j..../|
    [Thr 140271847081728] 0x7f9399f8d098 000048 00350005 000ac013 c014c009 c00a0032 |.5.............2|
    [Thr 140271847081728] 0x7f9399f8d0a8 000064 00380013 00040100 0030ff01 00010000 |.8.......0......|
    [Thr 140271847081728] 0x7f9399f8d0b8 000080 00000e00 0c000009 73617070 6f727461 |........sapporta|
    [Thr 140271847081728] 0x7f9399f8d0c8 000096 6c000500 05010000 0000000a 00060004 |l...............|
    [Thr 140271847081728] 0x7f9399f8d0d8 000112 00170018 000b0002 0100 |.......... |
    [Thr 140271847081728] ------------------------------------------------------------------------
    [Thr 140271847081728] *** ERROR => HttpPlugInHandleNetData: HttpParseRequestHeader failed (rc=701) [http_plgrt_m 2250]
    Trace File
       (7784bytes)
    Line: Filter:
    Thanks,
    Kundan

  • Load Balancer and Web Dispatcher "keepalive page"

    I would like our monitoring and load balancer to be able to perform http status check against SAP web dispatchers.
    Is there a built in "keepalive" page that can be queried within Web Dispatcher, or will a URL rule be needed?

    Dear Andrew,
    We need to provide access to our intranet to some outside companies for them to also use some of our portal applications. As per your answer, I understand that I can configure Web Disptacher to talk to the Cisco Load Balancer of our portal. In this case Web Dispatcher will work just as a reverse proxy. But when I discussed this with one of our basis resource, he told me that when we install and configure Web Dispatcher, it always ask for the Message Server URL and Port number, even if I just want to use Web Dispatcher as a Reverse Proxy. If his concerns are valid, I do not think I will be able to configure Web Dispatcher to access the cisco Load Balancer because I cannot put Cisco load banacer URL and port instead of the Message Server URL and Post Number. Can you kindly share your comment on the same?
    Now the second part of my question, if Web Dispatcher cannot be configured to talk to Load Balancer(as mentioned by our basis resource), I will have to use two load balancers. One web Dispatcher in DMZ as a Load Balancer *** Reverse Proxy for the external users. Second the internal Cisco Load Balancer for the intranet users. So the same portal will be accessed by two load balancers. My question here is, in this set up, can the portal work efficieintly here by distributing equal loads two both the server instances?
    Thank You,
    mansooralip1

  • Problems with the tag error-page in web.xml

    hi all, here is my code in my web.xml:
    <error-page>
    <exception-type>java.sql.SQLException</exception-type>
    <location>/ex.html</location>
    </error-page>
    it seems not to work, because my JavaBean where its the code to connect to my database and execute a query has an error i made it at purpose to see if the error page works, my JavaBean reports an error: column name not valid but the error-page didn�t work, i use a servlet which instantiates my JavaBean and then my servlet redirects to a JSP, obviouslly if an error occurs my servlet didnt redirect to any place, here is the code into my JavaBean, if anyone could help me i really appreciate it...
    public BeanLista seleccionaCliente()
    int nBandera = 0;
    BeanList lp = new BeanList();
    String cadena = "SELECT CODCLI, APEPATI FROM TESO.CLIENTE WHERE CODCLI like '2001120%' ";
    try
    context = new InitialContext();
    pool = (DataSource)context.lookup("jdbc/PRUEBADS");
    catch (NamingException ne)
    ne.printStackTrace();
    System.out.println("No se ha podido efectuar el Pool de Conexiones");
    try
    cc = pool.getConnection();
    ResultSet rs = cc.createStatement().executeQuery(cadena);
    cc.close();
    while(rs.next())
    BeanPrueba bp = new BeanPrueba();
    bp.setCodcli(rs.getString(1));
    bp.setApepat(rs.getString(2));
    lp.add(bp);
    return lp;
    }catch(SQLException sql){
    System.out.println("A ocurrido un error de SQL");
    System.out.println("Error de SQl capturado como : "+sql.getMessage());
    //sql.printStackTrace();
    return lp;
    }

    Can it be because you are catching your exception? Why don't you try throwing the same exception in the catch block and let the server handle it for you.
    Just a guess... Hope it works.
    VM

  • Handle exception on server side and display a customized jsp error page

    Hi,
    I am developing a java/j2EE web application using servlet, jsp, ejb3 with JBOSS and ECLIPSE.
    Two cases can occur on the server side :
    1) either I have not an expected result in a method and in this case I want to display an error page (a JSP page I suppose) with a personnalized error message
    2) or I have an exception thrown and I want to display the exception message in the former JSP page
    I don't know how to cope with this problem of personnalized error message (or the message of a thrown exception) with a JSP page.
    Does anybody can help me ? Thank you
    Edited by: xflamant on Jun 20, 2009 10:51 AM

    For the case of an unknown Error, simply use a default error page.
    The redirection to this page can be accomplished by inserting folowing code into your web.xml:
         <error-page>
            <exception-type>java.lang.Throwable</exception-type>
            <location>/WEB-INF/jsp/error.jsp</location>       
        </error-page>Known exception can be caught via a try-catch block.
    Then simply dispatch to the page you want displayed an add an attribute containing the error message to the response object.
    This attribute can then be used in the target page to diplay the error.

  • 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

  • Web Dispatcher not doing the load balancing on the portal

    Hi Experts
    I am having a production issue where the SAP web dispatcher is not doing the load balancing on the portal.
    We have ESS/MSS portal with 1 Message server and 2 Application servers. The Web dispatcher is installed on the message server itself. Here is my Web disp profile file
    Profile generated by sapwebdisp bootstrap
    unique instance number
    SAPSYSTEM = 16
    add default directory settings
    DIR_EXECUTABLE = .
    DIR_EXECUTABLE = F:\usr\sap\<SID>\sapwebdisp
    DIR_INSTANCE = .
    Accessibility of Message Servers
    rdisp/mshost = <hostname>.com
    ms/http_port = 8111
    #Log and Trace
    rdisp/TRACE = 2
    SAP Web Dispatcher Parameter
    wdisp/auto_refresh = 120
    wdisp/max_servers = 100
    wdisp/shm_attach_mode = 6
    configuration as per SAP note 538405
    icm/max_conn      = 7000
    icm/max_sockets   = 14000
    icm/req_queue_len = 6000
    icm/min_threads   = 100
    icm/max_threads   = 300
    mpi/total_size_MB = 500
    mpi/max_pipes       = 14000
    wdisp/HTTPS/max_pooled_con = 7000
    SAP Web Dispatcher Ports
    icm/server_port_0 = PROT=HTTP,PORT=8888
    SSL
    icm/server_port_1 = PROT=ROUTER,PORT=443, TIMEOUT=60
    SAP Web Dispatcher Web Administration
    icm/HTTP/admin_0 = PREFIX=/sap/wdisp/admin,DOCROOT=./admin,AUTHFILE=icmauth.txt
    wdisp/enable_j2ee_groups = TRUE
    wdisp/HTTPS/sticky_mask = 255.255.255.255
    In my Web dispatcher Admin page, I see all the three application servers, however the requests are going to only 1 App server. We are using ENd to End SSL configuration for the web dispatcher.
    We also have a reverse proxy in the landscape and reverse proxy is forwarding all the requests to the Web dispatcher. In Web disp Admin page>Dispatching Module>SSL End to END dispatching, I see only ONE table entry in the dispatching table and it is our Reverse Proxy.
    As all the requests are coming from only one source (Reverse proxy), it seems to me that the sap web dispatcher  is forwarding those to the same Application server every time.
    Can anyone please advise ?
    I also tried to configure logon group in NWA, the web dispatcher is detecting the logon group and all the app servers in the logon group. It still not doing the load balancing.
    I would greatly appreciate any help.
    Thanks
    Viny

    Vincent, can you please elaborate more ?  Is the web dispatcher not able to recognize stateful and stateless application requests ?
    I saw that the procedure for configuring SSL Termination on Web dispatcher is long and complicated and looks like SAP web dispatcher needs to have SSL certificate of its own. As we have no ABAP servers and only Java servers, I can not even create the PSEs using STRUST (as described in SAP help -http://help.sap.com/saphelp_nw70ehp1/helpdata/en/48/99c388d7c46bb9e10000000a42189d/frameset.htm
    We already have SSL certificates for Java App servers.
    I suppose there should be a way for web dispatcher to identify the incoming requests and forward to appropriate application servers.
    Any help is much appreciated.
    Thanks
    Viny

  • Tomcat, custom error page, sendError and encoding problems

    Hi All!
    I have the following code in my index.jsp page:
    <%
        if(hasParent && !imageStore.contains(parent))
            response.sendError(404, "Requested image with id=" + parent + " was not found on this server");
            return;
    %>following in the web.xml:
    <error-page>
        <error-code>404</error-code>
        <location>/404.jsp</location>
    </error-page>Both pages (index.jsp and 404.jsp) are windows-1251 encoded:
    <%@page contentType="text/html; charset=windows-1251"%>But I have an issue: all non-latin characters are mangled when 404.jsp displayed as the result of calling response.sendError.
    I mean, if I open myserver.com/404.jsp or myserver.com/non-existing-document-la-la-la, everything is okay. But when I open myserver.com/index.jsp?parent=123 it calls response.sendError - text is mangled.
    What's even more bizarre, Tomcat sends the right encoding in the response headers, but with ? instead non-latin characters:
    HTTP request sent, awaiting response...
    1 HTTP/1.1 404 Requested image with id=1231231 was not found on this server
    2 Content-Type: text/html;charset=windows-1251
    3 Date: Sat, 16 Sep 2006 18:14:27 GMT
    4 Server: Apache-Coyote/1.1
    5 Connection: Keep-Alive
    22:14:27 ERROR 404: Requested image with id=1231231 was not found on this server
    .I am using Apache Tomcat/5.0.28.
    I understand that this issue is not trivial, but I would appreciate any ideas.

    Hi All!
    I have the following code in my index.jsp page:
    <%
        if(hasParent && !imageStore.contains(parent))
            response.sendError(404, "Requested image with id=" + parent + " was not found on this server");
            return;
    %>following in the web.xml:
    <error-page>
        <error-code>404</error-code>
        <location>/404.jsp</location>
    </error-page>Both pages (index.jsp and 404.jsp) are windows-1251 encoded:
    <%@page contentType="text/html; charset=windows-1251"%>But I have an issue: all non-latin characters are mangled when 404.jsp displayed as the result of calling response.sendError.
    I mean, if I open myserver.com/404.jsp or myserver.com/non-existing-document-la-la-la, everything is okay. But when I open myserver.com/index.jsp?parent=123 it calls response.sendError - text is mangled.
    What's even more bizarre, Tomcat sends the right encoding in the response headers, but with ? instead non-latin characters:
    HTTP request sent, awaiting response...
    1 HTTP/1.1 404 Requested image with id=1231231 was not found on this server
    2 Content-Type: text/html;charset=windows-1251
    3 Date: Sat, 16 Sep 2006 18:14:27 GMT
    4 Server: Apache-Coyote/1.1
    5 Connection: Keep-Alive
    22:14:27 ERROR 404: Requested image with id=1231231 was not found on this server
    .I am using Apache Tomcat/5.0.28.
    I understand that this issue is not trivial, but I would appreciate any ideas.

  • Error-page encoding problem

    Hi all!
    I use AppServerPE9.0 and i need to custom error page
    web.xml:
        <error-page>
            <exception-type>java.lang.Throwable</exception-type>
            <location>/error.jsp</location>
        </error-page>
        <error-page>
            <error-code>403</error-code>
            <location>/error403.jsp</location>
        </error-page>
        <error-page>
            <error-code>404</error-code>
            <location>/error404.jsp</location>
        </error-page>
    ...Both error403.jsp and error404.jsp pages correctly showing UTF-8 symbols, but error.jsp:
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <jsp:include page="jspf/header.jsp" />
    <b>&#1054;&#1096;&#1080;&#1073;&#1082;&#1072;:</b><br />
    <%=((Throwable)request.getAttribute("javax.servlet.error.exception")).toString()%><br />
    <button onclick="goback()">&#1053;&#1072;&#1079;&#1072;&#1076;</button>
    <jsp:include page="jspf/footer.jsp" />Show '?' signes instead russian symbols.
    How to fix it?

    Where do you see that error?<br />
    Can you post a link?
    Did you try to clear the cache?
    *Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    *https://support.mozilla.org/kb/Clear+Recent+History
    What is the value of the <b>network.http.accept-encoding</b> on the <b>about:config</b> page?
    *http://kb.mozillazine.org/about:config

  • Webdispatcher custom error page

    Hello all,
    I'm trying to change the default error page on the webdispatcher when the connection to the portal/j2ee is lost.
    I succesfully created a page called ICMERR-EDISPATCHERR.html and put it into a webdispatcher subfolder and set the parameter icm/HTTP/error_templ_path to point to this folder so that instead of the "dispatching error" page I now have mine displayed.
    The problem is that my page has some images that aren't displayed.
    How can I tell the webdispatcher to search for the images locally and not on the j2ee ?
    Many thanks and regards,
    Michele

    Hi,
    I am facing the same issue. None of the images are getting displayed in the custom error message.
    Can you tell me how it was resolved?
    Thanks in advance,
    Pavithra

  • Error page, catching Exception

    Hello.
    When my page throws Exception, i redirect it to error page.
    I have this code in web.xml:
       <error-page>
          <exception-type>java.lang.Exception</exception-type>
          <location>/error.jsp</location>
       </error-page>      Everything is ok.
    But i want to write this exception to my log. I want do this in error page.
    So my question is:
    how can I get this exception on error page?

    Jsp' directive in /error.jsp
    <%@page isErrorPage="true" %>
    then variable "exeption" is availible in jsp, like this
    <%
    StackTraceElement[] st = exception.getStackTrace();
    %>

  • error-page in web.xml not working

    In my web.xml I have
    <error-page>
    <exception-type>java.lang.NullPointerException</exception-type>
    <location>/error.jsp</location>
    </error-page>
    I checked the page works by doing a /context/error.jsp and
    the page displays fine (it is a simple jsp page).
    I hit a struts action that gives me this in the std output.
    06/29 10:48:24 error
    [1]java.lang.NullPointerException
    at
    com.pearson.gs.cms.business.LoginService.verifyPassword(LoginService.java:232)
    at
    com.pearson.gs.cms.action.LoginAction.performCMSAction(LoginAction.java:92)
    at
    com.pearson.gs.cms.action.BaseCMSAction.execute(BaseCMSAction.java:48)
    at
    org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
    at
    org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
    at
    org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
    at
    org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
    at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at
    jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
    at
    jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
    at
    jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:259)
    at
    jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:541)
    at
    jrun.servlet.http.WebService.invokeRunnable(WebService.java:172)
    at
    jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
    at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
    [0]javax.servlet.ServletException
    at
    org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:523)
    at
    org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
    at
    org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
    at
    org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
    at
    org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
    at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at
    jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
    at
    jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
    at
    jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:259)
    at
    jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:541)
    at
    jrun.servlet.http.WebService.invokeRunnable(WebService.java:172)
    at
    jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
    at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
    I get a 500 error page instead of my /error.jsp page.
    I tried adding
    <error-page>
    <error-code>500</error-code>
    <location>/error.jsp</location>
    </error-page>
    but that doesn't work either.
    JRun 4.0
    Updater 6
    JDK 1.4.2
    Struts 1.2.8
    Any ideas what to try?

    a. Override your skeletons error.jsp to forward/redirect to your page.
    or
    b. If you primarily use pageflow portlets Define a shared flow which has an exception handling method and direct it to your page. Reference the shared flow in each of your controllers (i think global.app is deprecated in 10 otherwise you could do this there). this lets you log some additional information, plus gives you the added flexibility of dealing with different exception types
    or
    c. Override the path to error.jsp in your portlets properties (havent tested)
    Note if you are using servlets etc you still need your web.xml java.lang.Exception entry. The reason it doesnt get picked up is because the portal framework is handling the exception
    Edited by: deepshet on Dec 22, 2008 8:12 PM

Maybe you are looking for