Discussion:
Wicket and Spring Rest (MVC & DispatcherServlet)
kyrindorx
2018-07-20 07:13:54 UTC
Permalink
Hi,

I have to run a wicket app in the Servlet Context / Path "/*". I want to
use Spring MVC with Rest on "/api/*".

I found the WicketSessionFilter and some infos about it, but I can't see
a way to delegate into the Spring DispatcherServlet with "/*" bind on
the Wicket application filter.

I'll thankful for some hints :)

Greats
Kyrindorx


---------------------------------------------------------------------
To unsubscribe, e-mail: users-***@wicket.apache.org
For additional commands, e-mail: users-***@wicket.apache.org
Martin Grigorov
2018-07-20 07:21:06 UTC
Permalink
Hi,
Post by kyrindorx
Hi,
I have to run a wicket app in the Servlet Context / Path "/*". I want to
use Spring MVC with Rest on "/api/*".
You will need to use "ignorePaths" parameter on WicketFilter to tell it to
ignore requests to /api/.
See
https://github.com/apache/wicket/blob/9e42a9548adb0da540e4e87d491f5824e778537e/wicket-core/src/main/java/org/apache/wicket/protocol/http/WicketServlet.java#L77-L80
but apply it on the filter, not servlet.
Post by kyrindorx
I found the WicketSessionFilter and some infos about it, but I can't see
a way to delegate into the Spring DispatcherServlet with "/*" bind on
the Wicket application filter.
WicketSessionFilter helps to export the Wicket Application and Session
objects to other servlets and filters.
A Filter just wraps around other filters or servlets, so it delegates
automatically to any filters/servlets defined later in web.xml.
I.e. you need to define WicketSessionFilter before DispatcherServlet in
web.xml and it should just work.
Post by kyrindorx
I'll thankful for some hints :)
Greats
Kyrindorx
---------------------------------------------------------------------
Loading...