AquaLogic User Interaction Development Guide

     Previous Next  Open TOC in new window   View as PDF - New Window  Get Adobe Reader - New Window
Content starts here

Creating a Custom Ensemble Error Page

A custom error page can be displayed if there is an error in the Ensemble login process.

The pt:common.error, errortext and errorcodes tags allow you to insert Ensemble error information into a custom error page. Note: If these tags are included on a page, errors will no longer be displayed in the normal error location and will not be available after the page has been displayed.

By itself, the pt:common.errortext tag displays only the first error message, or the custom error message defined in the pt:text attribute. Other errors, as well as exception stack traces and extended error messages, will be ignored.

Combined with the pt:common.errorcodes tag and pt:logic tags, the pt:common.errortext tag can be used to display all error codes in memory. (If the errors have already been displayed, no error codes will be available.)

The example below (errorpage.jsp) illustrates how to retrieve and display a collection of errors and how to replace system errors with a custom error message. This example uses pt:logic tags to display the error collection.

 <%@page contentType="text/html;charset=UTF-8"%>
<HTML> <head> <link rel='stylesheet' type='text/css' href='css/main.css'/> </head>
<BODY>
<SPAN xmlns:pt='http://www.plumtree.com/xmlschemas/ptui/'>
<table class="banner" cellpadding="0" cellspacing="0"> <tr> 
   <td class="appLogo"></htm:td> 
   <td class="liquid"></htm:td> 
</tr> </table>
<br/>
<P><pt:logic.value pt:value="$#11.ptmsgs_login"/> </P>
<P>
<pt:common.errorcode pt:key="errorcodes"/>
<pt:logic.foreach pt:data="errorcodes" pt:var="code">
   <pt:common.errortext/>
   <br> 
   <pt:logic.value pt:value="$#12.ptmsgs_login"/><pt:logic.value pt:value="$code"/> 
   <br>

<!-- This is how you would override a specific error with a new message. -->
<!--
<pt:logic.intexpr pt:expr="($code)==2010" pt:key="isrequestedresource"/>
<pt:logic.if pt:expr="$isrequestedresource">
<pt:logic.iftrue>
   <pt:common.errortext pt:text="The requested resource is not in the resource map. This is a custom error message."/>
</pt:logic.iftrue>
<pt:logic.iffalse>
   <pt:common.errortext/>
</pt:logic.iffalse>
</pt:logic.if>
-->

</pt:logic.foreach> 
</P>
<P><pt:logic.value pt:value="$#13.ptmsgs_login"/></P>
</SPAN> </BODY> </HTML>

  Back to Top      Previous Next