Use
You can modify the standard KM error pages that are displayed when an error occurs, to your company branding needs.
Customizing Steps:
In SAP 7.3 KM error pages are rendered by XSLT. The corresponding XSL is "WDServletExceptionToHtml.xsl”.
Ø Log in to Portal Server through FTP/Telnet access as an administrator. In the physical folders browse and navigate to below path
\usr\sap\<SysID>\<InstID>\j2ee\cluster\apps\sap.com\com.sap.km.cm.main\servlet_jsp\com.sap.km.cm.main
\root\WEB-INF\private\lib
Ø Copy/Download the following jar “km.appl.servlet.webdav_core.jar".
Ø Take a backup of original jar before making modifications to it.
Ø Change the extension from .jar to .zip. Unzip the content and navigate to
\com\sapportals\wcm\protocol\webdav\server
Ø Look and Modify the WDServletExceptionToHtml.xsl file to your company branding needs.
<xsl:value-of select="HTTP-status" /> - Tag is responsible for Error Code e.g. 404
<xsl:copy-of select="message/node()" /> - Tag is responsible for Error Message
e.g. “The requested resource is not available”.
Ø At the end of the blog I have provided the WDServletExceptionToHtml.xsl code I have used.
Ø Ø zip the content again with same name km.appl.servlet.webdav_core.
Ø Place the jar at same location on server.
Ø Restart your server
Ø
Bingo!!! Now your new page will be displayed for KM errors
Result: Example for Error Code 404
Before Modification
After Modification
Note: This modification need to be reapplied to the system after it has been patched.
Regards,
Madhvika Joshi
Please do correct me if I have mentioned anything wrong.
Code:
<?xml version="1.0" encoding="iso-8859-1" ?>
<!--
Display WDServletException as HTML @author
-->
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0" xmlns:D="DAV:" xmlns:sap="urn:schemas-sap-com:wcm"
exclude-result-prefixes="D sap">
<xsl:output method="html" />
<xsl:param name="lang">
en
</xsl:param>
<xsl:param name="include-stacktrace" />
<xsl:template match="/">
<html>
<xsl:comment>
XSLT engine:
<xsl:value-of
select="concat('version: ',system-property('xsl:version'),' vendor: ',system-property('xsl:vendor'),' vendor-url: ',system-property('xsl:vendor-url'))" />
</xsl:comment>
<head>
<title>
<xsl:value-of select="/exception/HTTP-statusmessage" />
</title>
<style type="text/css">
h1 { font-family:tahoma; font-size:18pt; }
h2 {
font-family:tahoma; font-size:14pt; }
p { font-family:tahoma;
font-size:10pt; }
</style>
</head>
<body>
<xsl:apply-templates />
</body>
</html>
</xsl:template>
<xsl:template match="exception">
<!-- Start of Header Of Page -->
<table cellspacing="0" width="100%" style="background-color: white;">
<tbody>
<tr>
<th align="left">
<div style="margin-top: 1; margin-left: 10;">
<img title="Company Logo"
src="Provide URL for image you want to display e.g YOUR COMPANY LOGO"
alt="Company Logo" />
</div>
</th>
<th valign="middle" align="right">
<div
style="margin-right: 10; font-family: Calibri; color: #00868B; font-size: 15px; font-weight:bold; ">SAP Netweaver Portal</div>
</th>
</tr>
<tr height="5px"></tr>
<tr>
<td valign="top" align="left" colspan="2">
<div
style="font-family: Calibri; background-color: #00868B; font-size: 15px; padding: 5px; font-weight: bold; color:white">
<xsl:value-of select="HTTP-status" />
-
<xsl:copy-of select="message/node()" />
</div>
</td>
</tr>
<tr height="60px"></tr>
</tbody>
</table>
<!-- End of Header Of Page -->
<!-- Body Of Page - Start -->
<table align="center" width="70%" style="border-collapse:collapse">
<tbody>
<tr align="left" height="100%" style="border:2px solid #19798C">
<td valign="middle">
<div style="font-family: Calibri; padding: 5px 5px 5px 5px;">
<b style="color:#00484F">Error Code:</b>
<span style="margin-left:37px">
<xsl:value-of select="HTTP-status" />
</span>
</div>
<div style="font-family: Calibri; padding: 5px 5px 5px 5px;">
<b style="color:#00484F">Error Message:</b>
<span style="margin-left:12px">
<xsl:copy-of select="message/node()" />
</span>
</div>
<div style="font-family: Calibri; padding: 5px 5px 5px 5px;">
<b style="color:#00484F">Links:</b>
<a style="color: #00868B; margin-left:74px" href="http://scn.sap.com/welcome">SAP Forum</a>
</div>
</td>
</tr>
</tbody>
</table>
<!-- Body Of Page - End -->
<!--
<div> <xsl:choose> <xsl:when test="$include-stacktrace='yes'">
<xsl:attribute name="style">display: block;</xsl:attribute>
</xsl:when> <xsl:otherwise> <xsl:attribute name="style">display:
none;</xsl:attribute> </xsl:otherwise> </xsl:choose> <h2>stack
trace</h2> <p> <pre> <xsl:value-of select="stacktrace"/> </pre> </p>
-->
<!-- contained? -->
<!--
<xsl:for-each select="exception"> <h2>contained exception</h2> <p>
<xsl:copy-of select="message/node()" /> </p> <p> <pre> <xsl:value-of
select="stacktrace"/> </pre> </p> </xsl:for-each> </div>
-->
</xsl:template>
</xsl:transform>