Wicket+Spring 4 integration

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

Wicket+Spring 4 integration

Sandor Feher
Hi,

I'm just wondering when do you plan to support spring 4 in wicket-spring module ?
I try to implement an Oauth2 server on top of my Wicket app and oauth2 (at least 2.0.6 and above) requires spring 4. Right now I'm not able to upgrade due to lack of wicket spring 4 support.

TIA., Sandor
Reply | Threaded
Open this post in threaded view
|

Re: Wicket+Spring 4 integration

Martin Grigorov-4
Hi,

There is no reason Wicket to upgrade to Spring to 4.x. You can set Spring
version in your pom.xml to 4.x.

Wicket 7.x uses Spring 4:
https://github.com/apache/wicket/blob/master/pom.xml#L135

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Sep 24, 2015 at 3:56 PM, Sandor Feher <[hidden email]> wrote:

> Hi,
>
> I'm just wondering when do you plan to support spring 4 in wicket-spring
> module ?
> I try to implement an Oauth2 server on top of my Wicket app and oauth2 (at
> least 2.0.6 and above) requires spring 4. Right now I'm not able to upgrade
> due to lack of wicket spring 4 support.
>
> TIA., Sandor
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Wicket-Spring-4-integration-tp4672031.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Wicket+Spring 4 integration

Sandor Feher
So this means if I want to use Spring 4 then I must upgrade to Wicket 7. (Currently I use 6.20.0)

Can I do it safely ? Is 7.0 stable enough ?

TIA,Sandor
Reply | Threaded
Open this post in threaded view
|

Re: Wicket+Spring 4 integration

mihir
Just sharing my experience;  I recently migrated medium scale web
application (40+ screens) from wicket 1.4 + Spring 3.x + Hibernate 3.x to
Wicket 7+ Spring 4.2 +Hibernate 4.2 without any integration issue.

-Mihir.

On Thu, Sep 24, 2015, 1:15 PM Sandor Feher <[hidden email]> wrote:

> So this means if I want to use Spring 4 then I must upgrade to Wicket 7.
> (Currently I use 6.20.0)
>
> Can I do it safely ? Is 7.0 stable enough ?
>
> TIA,Sandor
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Wicket-Spring-4-integration-tp4672031p4672033.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Wicket+Spring 4 integration

Sandor Feher
Sounds good. I have up to 15 pages , wicket 6, hibernate 4 and spring 3.
Not so simple but not a nightmare.
Reply | Threaded
Open this post in threaded view
|

Re: Wicket+Spring 4 integration

Martin Grigorov-4
In reply to this post by Sandor Feher
On Thu, Sep 24, 2015 at 7:06 PM, Sandor Feher <[hidden email]> wrote:

> So this means if I want to use Spring 4 then I must upgrade to Wicket 7.
>

No.
You can use Spring 4.x with Wicket 6.x.


> (Currently I use 6.20.0)
>
> Can I do it safely ? Is 7.0 stable enough ?
>
> TIA,Sandor
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Wicket-Spring-4-integration-tp4672031p4672033.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Wicket+Spring 4 integration

Sandor Feher
I tried to do but I experienced some problems. They might be related to Spring but I'm not sure.
I use spring security. Default login page has changed in 4 so I set my wicket app's login page.
Then login page appeared but there was no action made when I clicked submit button.
I dig Springs migration guide but did not found any clue related to my issue.
I reverted back to 3.2.5 and everything worked like expected.
So this is the whole story.
Reply | Threaded
Open this post in threaded view
|

Re: Wicket+Spring 4 integration

aksarben
FYI, we use Spring 4.0.5 with Wicket 1.7.5 & have not encountered any
issues. Your mileage may vary.




From:   Sandor Feher <[hidden email]>
To:     [hidden email]
Date:   09/24/2015 01:37 PM
Subject:        Re: Wicket+Spring 4 integration



This email originated from outside of the company.  Please use discretion
if opening attachments or clicking on links.

I tried to do but I experienced some problems. They might be related to
Spring but I'm not sure.
I use spring security. Default login page has changed in 4 so I set my
wicket app's login page.
Then login page appeared but there was no action made when I clicked
submit
button.
I dig Springs migration guide but did not found any clue related to my
issue.
I reverted back to 3.2.5 and everything worked like expected.
So this is the whole story.

--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/Wicket-Spring-4-integration-tp4672031p4672037.html

Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]




**

This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient.  Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law.  If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies.
**
Reply | Threaded
Open this post in threaded view
|

Re: Wicket+Spring 4 integration

Martin Grigorov-4
On Thu, Sep 24, 2015 at 8:40 PM, Richard W. Adams <[hidden email]> wrote:

> FYI, we use Spring 4.0.5 with Wicket 1.7.5 & have not encountered any
>

There is no Wicket 1.7.5 :)


> issues. Your mileage may vary.
>
>
>
>
> From:   Sandor Feher <[hidden email]>
> To:     [hidden email]
> Date:   09/24/2015 01:37 PM
> Subject:        Re: Wicket+Spring 4 integration
>
>
>
> This email originated from outside of the company.  Please use discretion
> if opening attachments or clicking on links.
>
> I tried to do but I experienced some problems. They might be related to
> Spring but I'm not sure.
> I use spring security. Default login page has changed in 4 so I set my
> wicket app's login page.
> Then login page appeared but there was no action made when I clicked
> submit
> button.
> I dig Springs migration guide but did not found any clue related to my
> issue.
> I reverted back to 3.2.5 and everything worked like expected.
> So this is the whole story.
>
> --
> View this message in context:
>
> http://apache-wicket.1842946.n4.nabble.com/Wicket-Spring-4-integration-tp4672031p4672037.html
>
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
>
>
> **
>
> This email and any attachments may contain information that is
> confidential and/or privileged for the sole use of the intended recipient.
> Any use, review, disclosure, copying, distribution or reliance by others,
> and any forwarding of this email or its contents, without the express
> permission of the sender is strictly prohibited by law.  If you are not the
> intended recipient, please contact the sender immediately, delete the
> e-mail and destroy all copies.
> **
>
Reply | Threaded
Open this post in threaded view
|

Re: Wicket+Spring 4 integration

Sandor Feher
In reply to this post by Sandor Feher
Hi,

Finally I came over my problems. Now my 6.20.0 works fine together with Spring 4.1.5 and Spring Security 4.0.2.
My login page is mounted under /login. So the key was to define login-page and more important the login-process-url.

Hope this might help to others who struggling with upgrade to Spring Security 4.

 <sec:http create-session="never" auto-config="true" use-expressions="false">
        <sec:remember-me user-service-ref="CustomUserDetailsService"/>
        <sec:intercept-url pattern="/**"  />       
        <sec:form-login login-page="/login"  
                        login-processing-url="/"/>
                               
        <sec:csrf disabled="true"/>
</sec:http>
Reply | Threaded
Open this post in threaded view
|

Re: Wicket+Spring 4 integration

Martin Grigorov-4
Thanks for sharing!

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Sat, Sep 26, 2015 at 2:04 PM, Sandor Feher <[hidden email]> wrote:

> Hi,
>
> Finally I came over my problems. Now my 6.20.0 works fine together with
> Spring 4.1.5 and Spring Security 4.0.2.
> My login page is mounted under /login. So the key was to define login-page
> and more important the login-process-url.
>
> Hope this might help to others who struggling with upgrade to Spring
> Security 4.
>
>  <sec:http create-session="never" auto-config="true"
> use-expressions="false">
>         <sec:remember-me user-service-ref="CustomUserDetailsService"/>
>         <sec:intercept-url pattern="/**"  />
>         <sec:form-login login-page="/login"
>                         login-processing-url="/"/>
>
>         <sec:csrf disabled="true"/>
> </sec:http>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Wicket-Spring-4-integration-tp4672031p4672048.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
mr
Reply | Threaded
Open this post in threaded view
|

Re: Wicket+Spring 4 integration

mr
hi,

If I remove <sec:csrf disabled="true"/> tag(because I need csrf protection in my app)
I'm getting exception when pressing the button in my login page:
"Wicket.Ajax.Call.failure: Error while parsing response: Could not verify the provided CSRF token because your session was not found"
Wicket version-6.24.0
Spring-security version- 4.1.3

Can someone help me?
Reply | Threaded
Open this post in threaded view
|

Re: Wicket+Spring 4 integration

Martin Grigorov-4
Hi,

You could use global Ajax listener that adds the CSRF token to all Ajax
requests.
In YourApp#init() method do:
getAjaxRequestTargetListeners().add(new
AjaxRequestTarget.AbstractListener() {
   @Override
  public void updateAjaxAttributes(AbstractDefaultAjaxBehavior behavior,
AjaxRequestAttributes attributes)
  {
       if (attributes.getMethod() == Method.POST) {
          attributes.getExtraParameters().put("CSRF-TOKEN",
theTokenTakenFromSpringSecurity);
       }
  }
})

I am not sure where Spring Security looks for the token in a request. If it
is not possible via request parameter then you can use
AjaxCallListener#beforeSend() to put it in the headers.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Wed, Oct 5, 2016 at 10:53 AM, mr <[hidden email]> wrote:

> hi,
>
> If I remove <sec:csrf disabled="true"/> tag(because I need csrf protection
> in my app)
> I'm getting exception when pressing the button in my login page:
> "Wicket.Ajax.Call.failure: Error while parsing response: Could not verify
> the provided CSRF token because your session was not found"
> Wicket version-6.24.0
> Spring-security version- 4.1.3
>
> Can someone help me?
>
> --
> View this message in context: http://apache-wicket.1842946.
> n4.nabble.com/Wicket-Spring-4-integration-tp4672031p4675645.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>