Skip to Content

How to customize the SAP Portal Error Pages?

Hello all, 

 

As of SAP NetWeaver Enhancement Package 2 for Portal, a new method for customizing the traditional Portal (PRT) error pages was introduced:

 

 

 

 

 

 

 

The technique to customize the PRT error page is by developing a custom error page (represented by a Portal Component) and registering this error page to the Portal Runtime engine. As a result, the custom component will be displayed as the error page, instead of the PRT out-of-the-box error page.

Step-by-step guide to customize the error page:

1. Develop a customer error page component

  • Create a new Portal Application Project called: prtCustomError (for example)
  • Create a new Portal Application Object called com.sap.portal.demo.prtCustomErrorPage as an object in the prtCustomError project
  • Write your own UI to be displayed to the end-users as the error page

 

2. Register your custom component to the Portal runtime environment

  • Login to the Portal as a System Administrator
  • Navigate to:System Administration -> System Configuration -> Service Configuration
  • Under the Portal Runtime folder open the Service Configuration component and set the property portal.runtime.exception.errorcomponent to your custom error page: applicationName.componentName

 

 

 

 

3. Restart the server (don’t forget this step, otherwise your component will not get registered to the PRT)

 

Your new customized error page is ready!

 

You can download a (very trivial) sample error page which will be your starting point for developing your own custom error page. The errorComponent of this application is: CustomError.CustomErrorPage

 

For more details, please refer to the official documentation: help.sap.com -> SAP Enhancement Package 2 -> Configuring the Portal Runtime Properties (Enhanced) 

 

Hope you will find this helpful!

Aviad Rivlin

8 Comments
You must be Logged on to comment or reply to a post.
  • Hi Aviad,

    Thanks for pointing this new functionality out with a nice easy to follow guide.  I'm just wondering if there is any similar simplifications introduced for managing Web Application Server error pages such as 404's, etc.

    Cheers,
    Matt

    • Hi Matt,
      The WebAS needs to obey the J2EE specification so things are more complicated there. You can check SAP Note 795699 (Customizing default error messages for HTTP) for some ideas on customizing specifically 404.

      Best Regards,
      Iavor

      • Good point, and I should have realised; but thanks for the reference to the OSS note which is unfortunately, a little temperamental to get right from past experiences. 

        Note - I would still think that a good idea for SAP would be to change all the standard messages to use includes, CSS files and class declarations that could be overwritten quickly to at least allow the messages to look like they are company messages rather than SAP standard WAS methods.

        Just a thought.

        Cheers,
        Matt

        • Hi Matt,
          Thanks, I completely agree. For releases in maintenance the functionality will unfortunately not change, but I am welcoming any suggestions towards improving the note to make it less challenging.
          Probably in future versions the Dev colleagues will address also this point.

          Best Regards,
          Iavor

          • Thanks Iavor.

            To be honest, I was leveraging the Best Practices guide for doing this previously (from recollection); and unfortunately I didn't come across this note; but that said; it's still a little hit and miss when you do this as I recall.

            Cheers,
            Matt

  • Can this be possible in older portal version below Enhancement Package 2 in any other way, as I dont see any property file as such to set with the customized portal component.