Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to emulate wicket setResponsePage() in spring security
    text
    copied!<p><strong>Situation</strong>: user is forced to change password when button "Change password" is clicked. This click fires form overridden method onSubmit() (Wicket). In this method:</p> <pre><code>protected void onSubmit() { //changing password by updating it in DB // autologin user with changed password in system //set response page (wicket style) setResponsePage(RestorePasswordPage.class); } </code></pre> <p>Actually call setResponsePage(...) is the call to Wicket Component.setResponsePage()</p> <pre><code>public final &lt;C extends Page&gt; void setResponsePage(final Class&lt;C&gt; cls) { getRequestCycle().setResponsePage(cls); } </code></pre> <p>My task was to substitute wicket on Spring security and it was solved - I intercept call to this method in Spring Filter Security Chain (class below is one of the components of this chaing). And can do all the things from code snippet above except one - I don't know how to make redirection to RestorePasswordPage</p> <pre><code>public class ForgotPasswordForcePasswordChangeEventHandler implements CustomEventHandler { public void handle(HttpServletRequest request, HttpServletResponse response) { // 1. Extract current customer // 2. Extract changed password // 3. Updates user through external web service // 4. Prepares data for authentication // 5. Clears security context to remove current authentication //redirect to the same page as in wicket HOW??? } } </code></pre> <p><strong>Questions</strong>: </p> <ol> <li>Is it any way to get access to Wicket RequestCycle if I got only HttpServletRequest request as input. </li> <li>Any other way to solve this problem?</li> </ol>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload