What are good ways to provide access to physical subdirectories within a Madvoc app with makros?

19 views
Skip to first unread message

BloodySmartie

unread,
Jul 4, 2014, 6:05:28 AM7/4/14
to jod...@googlegroups.com
Hi Jodders,

i hope the subject of my question wasn't too confusing. I'll explain what i mean. I have a Madvoc application which has several very generic makro actions in it. For example:
@Action{"/${part1}/${part2}"}

So all requests that meet this makro are handled by the action. I've got some "physical" subdirectories in my WEB-INF directory for css, js and images. So when, for example "/css/styles.css" is requested, Madvoc is trying to handle this request and I don't know what to do to exclude those paths.

I was reading about something promising in the Docs. It seems to be possible to control which requests are handled by Madvoc and which aren't by writing a custom MadvocController. Unfortunately, i didn't find out how to install it.

As all of the time, i'd be very thankful for a little help.

Best regards,

David


jodder

unread,
Jul 4, 2014, 3:15:54 PM7/4/14
to jod...@googlegroups.com
You are right, custom MadvocController should be the way how to do it. Let me explain it:

Madvoc servlet filters calls MadvocController.invoke() method and pass 'actionPath` string, together with servlet request/response. So if you have your own controller, you can overwrite invoke() method and simply return the same `actionPath` (or any non-null value). By returning a non-null value we are telling the filter that path is not consumed and that it should proceed. This is exactly the same what happens when path is not matched.

You can register your version of madvoc controller in WebApplication class, like you can change any other component.

Hope this helps !

BloodySmartie

unread,
Jul 5, 2014, 10:05:44 AM7/5/14
to jod...@googlegroups.com
I did it and it works like a charm - thanks a lot :)
Reply all
Reply to author
Forward
0 new messages