[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

Power User

Joined: 21/11/2007 12:23:06
Messages: 5112

(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?


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:

     protected void reactOnProblemDuringWorkpageStart(Throwable t)
         while (true)
             if (t.getCause() == null)
                 t = t.getCause();

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