[Logo] Enterprise Client Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Openeing a page in workplace which must not be opened - Can I abort?  XML
Forum Index -> Development
Author Message
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5518
Offline

(from mail conversation)

Scenario: a page is opened in the workplace (e.g. through function tree). In the constructor of the corresponding page bean a missing authorization is detected. - Can the process of starting the page be interrupted?

Response:

The starting is done through interface "IWorkpageStarter" interface. Default implementation is "WorkpageDefaultStarter".

If the page definition (WorkpageStartInfo instance) is done by property "pageBeanName" (and not by "jspPage"), then the resolution of the page bean instance is executed immediately. In this case, when an error happens, then the WorkpageDefaultStarter-instance invokes its protected method:

Code:
     protected void reactOnProblemDuringWorkpageStart(Throwable t)
     {
         while (true)
         {
             if (t.getCause() == null)
                 break;
             else
                 t = t.getCause();
         }
         OKPopup.createInstance("",t.getMessage());
     }
 


This means: you may throw an Error or RuntimeException - the result will be shown in the OK dialog.

You can implement your own IWorkpageStarter-implementation, we recommend to always inherit from our default implementation. In your own implementation you can override the protected-method and introduce some different management of error-situations, of course.


One comment: if defining the page in WorkpageStartInfo with its "jspPage" property, then the resolution of the corresponding bean is done at the render-phase of the request processing. Here it is too late to influence the workplace ;-).

Björn Müller, CaptainCasa GmbH
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team