Discussion:
Wicket and Jersey Integration
Илья Нарыжный
2018-12-02 17:50:00 UTC
Permalink
Hello,

I know that story of wicket and different jax-rs containers is pretty long.
Currently we are using Jersey as a servlet under wicket filter, but we
don't like that in this case REST end-points have nothing about Wicket: no
wicket session available, no wicket request cycle listeners executed and
etc.
There is an idea to implement IRequestHandler which will handle as Jersey
Container. So it will be executed under wicket umbrella.

Questions:
1) What do you think about this?
2) Is there some existing implementation of what I'm talking about?

Please reply also even in a case if you interested in this library. It will
help me to understand: does it worst to make this integration as a separate
library or we can embed into our code within Orienteer.

Thanks,
Ilia

---------------------------------------------
Orienteer(http://orienteer.org) - open source Business Application Platform
Ernesto Reinaldo Barreiro
2018-12-03 06:15:39 UTC
Permalink
Hi Ilia,

If WicketSessionFilter not enough for your needs? It is a filter you can
put in front of JERSEY and you will have some wicket related things.
Post by Илья Нарыжный
Hello,
I know that story of wicket and different jax-rs containers is pretty long.
Currently we are using Jersey as a servlet under wicket filter, but we
don't like that in this case REST end-points have nothing about Wicket: no
wicket session available, no wicket request cycle listeners executed and
etc.
There is an idea to implement IRequestHandler which will handle as Jersey
Container. So it will be executed under wicket umbrella.
1) What do you think about this?
2) Is there some existing implementation of what I'm talking about?
Please reply also even in a case if you interested in this library. It will
help me to understand: does it worst to make this integration as a separate
library or we can embed into our code within Orienteer.
Thanks,
Ilia
---------------------------------------------
Orienteer(http://orienteer.org) - open source Business Application Platform
--
Regards - Ernesto Reinaldo Barreiro
Илья Нарыжный
2018-12-03 06:22:04 UTC
Permalink
Ernesto,

WicketSessionFilter is cool workaround for most of cases, but in our case
we need deeper integration. For example to have the same security model for
wicket pages and rests.
Apparently, Jersey is not complex to integrate with. I already have more or
less working implementation of working Jersey under Wicket.

Thanks,
Ilia

---------------------------------------------
Orienteer(http://orienteer.org) - open source Business Application Platform

On Sun, Dec 2, 2018 at 10:16 PM Ernesto Reinaldo Barreiro <
Post by Ernesto Reinaldo Barreiro
Hi Ilia,
If WicketSessionFilter not enough for your needs? It is a filter you can
put in front of JERSEY and you will have some wicket related things.
Post by Илья Нарыжный
Hello,
I know that story of wicket and different jax-rs containers is pretty
long.
Post by Илья Нарыжный
Currently we are using Jersey as a servlet under wicket filter, but we
no
Post by Илья Нарыжный
wicket session available, no wicket request cycle listeners executed and
etc.
There is an idea to implement IRequestHandler which will handle as Jersey
Container. So it will be executed under wicket umbrella.
1) What do you think about this?
2) Is there some existing implementation of what I'm talking about?
Please reply also even in a case if you interested in this library. It
will
Post by Илья Нарыжный
help me to understand: does it worst to make this integration as a
separate
Post by Илья Нарыжный
library or we can embed into our code within Orienteer.
Thanks,
Ilia
---------------------------------------------
Orienteer(http://orienteer.org) - open source Business Application Platform
--
Regards - Ernesto Reinaldo Barreiro
Ernesto Reinaldo Barreiro
2018-12-03 07:17:57 UTC
Permalink
Ilia,

Ok. Them "mounting" JERSEY as a wicket "resource" might be a solution?
Post by Илья Нарыжный
Ernesto,
WicketSessionFilter is cool workaround for most of cases, but in our case
we need deeper integration. For example to have the same security model for
wicket pages and rests.
Apparently, Jersey is not complex to integrate with. I already have more or
less working implementation of working Jersey under Wicket.
Thanks,
Ilia
---------------------------------------------
Orienteer(http://orienteer.org) - open source Business Application Platform
On Sun, Dec 2, 2018 at 10:16 PM Ernesto Reinaldo Barreiro <
Post by Ernesto Reinaldo Barreiro
Hi Ilia,
If WicketSessionFilter not enough for your needs? It is a filter you can
put in front of JERSEY and you will have some wicket related things.
Post by Илья Нарыжный
Hello,
I know that story of wicket and different jax-rs containers is pretty
long.
Post by Илья Нарыжный
Currently we are using Jersey as a servlet under wicket filter, but we
no
Post by Илья Нарыжный
wicket session available, no wicket request cycle listeners executed
and
Post by Ernesto Reinaldo Barreiro
Post by Илья Нарыжный
etc.
There is an idea to implement IRequestHandler which will handle as
Jersey
Post by Ernesto Reinaldo Barreiro
Post by Илья Нарыжный
Container. So it will be executed under wicket umbrella.
1) What do you think about this?
2) Is there some existing implementation of what I'm talking about?
Please reply also even in a case if you interested in this library. It
will
Post by Илья Нарыжный
help me to understand: does it worst to make this integration as a
separate
Post by Илья Нарыжный
library or we can embed into our code within Orienteer.
Thanks,
Ilia
---------------------------------------------
Orienteer(http://orienteer.org) - open source Business Application Platform
--
Regards - Ernesto Reinaldo Barreiro
--
Regards - Ernesto Reinaldo Barreiro
Martin Grigorov
2018-12-03 07:44:27 UTC
Permalink
You can also take a look at
https://github.com/wicketstuff/core/tree/master/wicketstuff-restannotations-parent
It provides an implementation of JAX-RS based on Wicket IResource
Post by Ernesto Reinaldo Barreiro
Ilia,
Ok. Them "mounting" JERSEY as a wicket "resource" might be a solution?
Post by Илья Нарыжный
Ernesto,
WicketSessionFilter is cool workaround for most of cases, but in our case
we need deeper integration. For example to have the same security model
for
Post by Илья Нарыжный
wicket pages and rests.
Apparently, Jersey is not complex to integrate with. I already have more
or
Post by Илья Нарыжный
less working implementation of working Jersey under Wicket.
Thanks,
Ilia
---------------------------------------------
Orienteer(http://orienteer.org) - open source Business Application Platform
On Sun, Dec 2, 2018 at 10:16 PM Ernesto Reinaldo Barreiro <
Post by Ernesto Reinaldo Barreiro
Hi Ilia,
If WicketSessionFilter not enough for your needs? It is a filter you
can
Post by Илья Нарыжный
Post by Ernesto Reinaldo Barreiro
put in front of JERSEY and you will have some wicket related things.
Post by Илья Нарыжный
Hello,
I know that story of wicket and different jax-rs containers is pretty
long.
Post by Илья Нарыжный
Currently we are using Jersey as a servlet under wicket filter, but
we
Post by Илья Нарыжный
Post by Ernesto Reinaldo Barreiro
Post by Илья Нарыжный
don't like that in this case REST end-points have nothing about
no
Post by Илья Нарыжный
wicket session available, no wicket request cycle listeners executed
and
Post by Ernesto Reinaldo Barreiro
Post by Илья Нарыжный
etc.
There is an idea to implement IRequestHandler which will handle as
Jersey
Post by Ernesto Reinaldo Barreiro
Post by Илья Нарыжный
Container. So it will be executed under wicket umbrella.
1) What do you think about this?
2) Is there some existing implementation of what I'm talking about?
Please reply also even in a case if you interested in this library.
It
Post by Илья Нарыжный
Post by Ernesto Reinaldo Barreiro
will
Post by Илья Нарыжный
help me to understand: does it worst to make this integration as a
separate
Post by Илья Нарыжный
library or we can embed into our code within Orienteer.
Thanks,
Ilia
---------------------------------------------
Orienteer(http://orienteer.org) - open source Business Application Platform
--
Regards - Ernesto Reinaldo Barreiro
--
Regards - Ernesto Reinaldo Barreiro
Илья Нарыжный
2018-12-04 07:27:39 UTC
Permalink
Martin,

Thank you - we were considering this library previously, but it's not
JAX-RS compatible and don't have cool features for security/marshaling/etc.
And that's why we used Jersey.
But this time needed integration is so deep, so we can't keep 2 these
components separately.

Ernesto,

Yes - I think that mounting and embedding should help here a lot.

Btw, here is first working version:
https://github.com/OrienteerBAP/wicket-jersey. So it's possible to mount
JAX-RS applications and use them from Wicket. You can check tests and mock
jax-rs resources.

Have related question:
IRequestMapper has getCompatibilityScore() to find proper mapper for a
request. But is there some good way to go ahead with next IRequestMapper if
first one after scoring do return 404?

Thanks,
Ilia

---------------------------------------------
Orienteer(http://orienteer.org) - open source Business Application Platform
Post by Martin Grigorov
You can also take a look at
https://github.com/wicketstuff/core/tree/master/wicketstuff-restannotations-parent
It provides an implementation of JAX-RS based on Wicket IResource
On Mon, Dec 3, 2018 at 9:29 AM Ernesto Reinaldo Barreiro <
Post by Ernesto Reinaldo Barreiro
Ilia,
Ok. Them "mounting" JERSEY as a wicket "resource" might be a solution?
Post by Илья Нарыжный
Ernesto,
WicketSessionFilter is cool workaround for most of cases, but in our
case
Post by Ernesto Reinaldo Barreiro
Post by Илья Нарыжный
we need deeper integration. For example to have the same security model
for
Post by Илья Нарыжный
wicket pages and rests.
Apparently, Jersey is not complex to integrate with. I already have
more
Post by Ernesto Reinaldo Barreiro
or
Post by Илья Нарыжный
less working implementation of working Jersey under Wicket.
Thanks,
Ilia
---------------------------------------------
Orienteer(http://orienteer.org) - open source Business Application Platform
On Sun, Dec 2, 2018 at 10:16 PM Ernesto Reinaldo Barreiro <
Post by Ernesto Reinaldo Barreiro
Hi Ilia,
If WicketSessionFilter not enough for your needs? It is a filter you
can
Post by Илья Нарыжный
Post by Ernesto Reinaldo Barreiro
put in front of JERSEY and you will have some wicket related things.
Post by Илья Нарыжный
Hello,
I know that story of wicket and different jax-rs containers is
pretty
Post by Ernesto Reinaldo Barreiro
Post by Илья Нарыжный
Post by Ernesto Reinaldo Barreiro
long.
Post by Илья Нарыжный
Currently we are using Jersey as a servlet under wicket filter, but
we
Post by Илья Нарыжный
Post by Ernesto Reinaldo Barreiro
Post by Илья Нарыжный
don't like that in this case REST end-points have nothing about
no
Post by Илья Нарыжный
wicket session available, no wicket request cycle listeners
executed
Post by Ernesto Reinaldo Barreiro
Post by Илья Нарыжный
and
Post by Ernesto Reinaldo Barreiro
Post by Илья Нарыжный
etc.
There is an idea to implement IRequestHandler which will handle as
Jersey
Post by Ernesto Reinaldo Barreiro
Post by Илья Нарыжный
Container. So it will be executed under wicket umbrella.
1) What do you think about this?
2) Is there some existing implementation of what I'm talking about?
Please reply also even in a case if you interested in this library.
It
Post by Илья Нарыжный
Post by Ernesto Reinaldo Barreiro
will
Post by Илья Нарыжный
help me to understand: does it worst to make this integration as a
separate
Post by Илья Нарыжный
library or we can embed into our code within Orienteer.
Thanks,
Ilia
---------------------------------------------
Orienteer(http://orienteer.org) - open source Business Application Platform
--
Regards - Ernesto Reinaldo Barreiro
--
Regards - Ernesto Reinaldo Barreiro
Илья Нарыжный
2018-12-04 09:31:02 UTC
Permalink
OK. Last my question was solved through
RequestCycle.replaceAllRequestHandlers(handler);

Thanks,
Ilia

---------------------------------------------
Orienteer(http://orienteer.org) - open source Business Application Platform
Post by Илья Нарыжный
Martin,
Thank you - we were considering this library previously, but it's not
JAX-RS compatible and don't have cool features for security/marshaling/etc.
And that's why we used Jersey.
But this time needed integration is so deep, so we can't keep 2 these
components separately.
Ernesto,
Yes - I think that mounting and embedding should help here a lot.
https://github.com/OrienteerBAP/wicket-jersey. So it's possible to mount
JAX-RS applications and use them from Wicket. You can check tests and mock
jax-rs resources.
IRequestMapper has getCompatibilityScore() to find proper mapper for a
request. But is there some good way to go ahead with next IRequestMapper if
first one after scoring do return 404?
Thanks,
Ilia
---------------------------------------------
Orienteer(http://orienteer.org) - open source Business Application Platform
Post by Martin Grigorov
You can also take a look at
https://github.com/wicketstuff/core/tree/master/wicketstuff-restannotations-parent
It provides an implementation of JAX-RS based on Wicket IResource
On Mon, Dec 3, 2018 at 9:29 AM Ernesto Reinaldo Barreiro <
Post by Ernesto Reinaldo Barreiro
Ilia,
Ok. Them "mounting" JERSEY as a wicket "resource" might be a solution?
Post by Илья Нарыжный
Ernesto,
WicketSessionFilter is cool workaround for most of cases, but in our
case
Post by Ernesto Reinaldo Barreiro
Post by Илья Нарыжный
we need deeper integration. For example to have the same security
model
Post by Ernesto Reinaldo Barreiro
for
Post by Илья Нарыжный
wicket pages and rests.
Apparently, Jersey is not complex to integrate with. I already have
more
Post by Ernesto Reinaldo Barreiro
or
Post by Илья Нарыжный
less working implementation of working Jersey under Wicket.
Thanks,
Ilia
---------------------------------------------
Orienteer(http://orienteer.org) - open source Business Application Platform
On Sun, Dec 2, 2018 at 10:16 PM Ernesto Reinaldo Barreiro <
Post by Ernesto Reinaldo Barreiro
Hi Ilia,
If WicketSessionFilter not enough for your needs? It is a filter you
can
Post by Илья Нарыжный
Post by Ernesto Reinaldo Barreiro
put in front of JERSEY and you will have some wicket related things.
Post by Илья Нарыжный
Hello,
I know that story of wicket and different jax-rs containers is
pretty
Post by Ernesto Reinaldo Barreiro
Post by Илья Нарыжный
Post by Ernesto Reinaldo Barreiro
long.
Post by Илья Нарыжный
Currently we are using Jersey as a servlet under wicket filter,
but
Post by Ernesto Reinaldo Barreiro
we
Post by Илья Нарыжный
Post by Ernesto Reinaldo Barreiro
Post by Илья Нарыжный
don't like that in this case REST end-points have nothing about
no
Post by Илья Нарыжный
wicket session available, no wicket request cycle listeners
executed
Post by Ernesto Reinaldo Barreiro
Post by Илья Нарыжный
and
Post by Ernesto Reinaldo Barreiro
Post by Илья Нарыжный
etc.
There is an idea to implement IRequestHandler which will handle as
Jersey
Post by Ernesto Reinaldo Barreiro
Post by Илья Нарыжный
Container. So it will be executed under wicket umbrella.
1) What do you think about this?
2) Is there some existing implementation of what I'm talking
about?
Post by Ernesto Reinaldo Barreiro
Post by Илья Нарыжный
Post by Ernesto Reinaldo Barreiro
Post by Илья Нарыжный
Please reply also even in a case if you interested in this
library.
Post by Ernesto Reinaldo Barreiro
It
Post by Илья Нарыжный
Post by Ernesto Reinaldo Barreiro
will
Post by Илья Нарыжный
help me to understand: does it worst to make this integration as a
separate
Post by Илья Нарыжный
library or we can embed into our code within Orienteer.
Thanks,
Ilia
---------------------------------------------
Orienteer(http://orienteer.org) - open source Business
Application
Post by Ernesto Reinaldo Barreiro
Post by Илья Нарыжный
Post by Ernesto Reinaldo Barreiro
Post by Илья Нарыжный
Platform
--
Regards - Ernesto Reinaldo Barreiro
--
Regards - Ernesto Reinaldo Barreiro
Loading...