frameworks - Redirection problem in Java(Wicket) -


I have a page inherited from the webpage and protected by the square below:

  The public final category WiaAuthorizationStrategy implies IAuthorizationStrategy, IUnuthorizedComponentInstantiationListener {Private RealmPolicy roleManager; Private static WiaAuthorizationStrategy example; Personal WiaAuthorizationStrategy () {roleManager = RealmPolicy.getInstance (); } Public Static WiaAuthorizationStrategy getInstance () {if (Example == Faucet) Example = New WiaAuthorizationStrategy (); Return example; } Public Boolean Instantation is authorized (class component class) {if (ProtectedPage.class.isAssignableFrom (componentClass)) {if (WiaSession.get (.) GetUser () == faucet) {return false; } If (RoleManager.isAuthorized (WiaSession.get (.) GetUser (). GetRole (), componentClass.getName ()) // // WiaSession.get (). IsAuthenticated (); {WiaSession.get () SetAccess (wrong); return false; } And true back; } Back true; } Public Zero (Component Component) on Unknown Authorization (New Resume ResponseActrenderPage exception (login class);} Public boolean is ActionActioned (Component Component, Action Action) {//System.out.println("Name: "+ component. GetClass (). GetName () + "\ n Action:" + action.getName () + "\ NUser:" + WiaSession.get (). GetUser ()); If (action.equals (component.RENDER)) { If (roleManager.containClass (component.getClass (). GetName ()) {if (WiaSession.get (). GetUser ()! = Null} {if RoleManager (.isAuthorized (WiaSession.get (.) GetUser () GetRole (), component .getClass (). GetName ())) {WiaSession.get (.) SetAccess (incorrect); Description is false;} Back true;} The details are false;}} True truth;}}  

When I enter that page then it's OK and everything works, but when I press Ctrl + F5 Redirects the page to the page which is the default for entering protected pages. I tried to debug the code and I found that the Super () function in the ProtectedPage class does this and in debugging I enter this part of the code Can not lounge down this square Is:

  Public abstract class increases the ProtectedPage webpage {public protected page () { 

---- >>> Super (); VerifyAccess (); }

  Secure void verifyAccess () {// redirect to invalid page on invalid access. If the user is the legend ()! (New user's login) (new restart response intersection page (login class);}} protected boolean is user login () {return (get rid of (vicisson) getSession ()) .Or authorized ();}}  

I have signed ---- >>> Sign in code Can anyone help me with this problem?

Do not use anything like Verified when you have an IAuthorizationStrategy installed;


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -