interface icredentialsprovider { credentials getusercredentials(); }
public class customwebsession extends authenticatedsession implements
icredentialsprovider {
....}
class mocksession extends websession implements icredentialsprovider {
....
}
((icredentialsprovider) getSession()).getUserCredentials();
-igor
On Dec 18, 2007 9:42 PM, Ravi_116 <[EMAIL PROTECTED]> wrote:
>
> I have a custom WebSession (Extends AuthenticatedWebSession). What is correct
> way to access the user credentials from a Page. I tried to access the user
> credentials from the constructor of my custom page.
>
> ((CustomWebSession) getSession()).getUserCredentials();
>
>
> However, unit testing that page has become very painful. I would not like to
> use AuthenticatedWebApplication, but dummy up the MockWebSession for unit
> testing my pages.
>
> Ravi
>
> --
> View this message in context:
> http://www.nabble.com/Accessing-username-from-Page---Unit-test-tp14411574p14411574.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]