you could use an IAuthorizationStrategy to perform a check at the
constructor of your page.
This is from the java doc
/**
 * Authorization strategies control on a low level how authorization is implied.
 * A strategy itself is generally not responsible for enforcing it. What a
 * strategy does do is tell the framework whether a component may be created
 * (especialy usefull for implementing secure bookmarkable pages and components
 * that should always be secure no matter what environment they are put it),
 * whether it may be rendered (which can result in components being 'filtered'
 * from a page, or triggering the page to not be rendered at all and redirecting
 * to a error or logon page), and whether a component may be enabled (thus
 * controlling it's reachability etc) at all.
 *
 * @author Eelco Hillenius
 * @author Jonathan Locke
 */
The only catch is that you specify the strategy application wide so
your strategy will be called for every component you create (not just
pages).
This is ofcourse not a big problem, just something i would like to see
changed (just in case you are reading this eelco ;))

2005/12/22, John Patterson <[EMAIL PROTECTED]>:
> Hi Wicketeers,
>
> I have a page which can only be viewed if the user is logged in.  If the user
> is not logged in then checkAccess() redirects to a sign in page and returns
> false.
>
> I moved my "page building" code to the onBeginRequest() method so that it is
> only called when it is really needed (ie not when the page cannot be viewed).
>
> However, in my original page doRender() is still called and the html is parsed
> etc.  This involves looking up data from the database which is never shown.
>
> Is there any way to build a page that will only be built if it is actually
> going to be displayed?
>
> Thanks,
>
> John.
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
> for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
> http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to