Author |
Message |
22/05/2015 12:21:44
|
dperezlopez
Active
Joined: 23/01/2015 14:55:04
Messages: 18
Offline
|
Hi again!
Here comes my doubt about the dispatcher info.
At the moment we need to specify the package names specifically in the dispatcherinfo.xml in order for the dispatcher to take them into account.
For example now in my project structure I have something like:
managedbeans.macros
managedbeans.users
managedbeans.reports
and I declare the full package path for each of them in the dispatcherinfo.xml
Would it be a problem that during the dispatcherinfo.xml analysis the subpackages from the "managedbeans" package were also included automatically? (if it is a very dramatic change also the activation of this functionallity via flag could be interesting).
Thanks!
Best regards
David
|
David |
|
|
22/05/2015 13:17:30
|
CaptainCasa
Power User
Joined: 21/11/2007 12:23:06
Messages: 5520
Offline
|
Hi,
yes this is possible, and yes: we will add an own activation flag in the XML definition in order to keep compatibility.
Am not 100% sure, but should be in next update.
Regards, Björn
|
Björn Müller, CaptainCasa GmbH |
|
|
24/05/2015 16:24:06
|
CaptainCasa
Power User
Joined: 21/11/2007 12:23:06
Messages: 5520
Offline
|
Hi,
I have to step back from what I said... there is no API that provides a list of all packages. The Package.getPackages() only delivers these ones which are already loaded...
Reagrds, Björn
|
Björn Müller, CaptainCasa GmbH |
|
|
19/06/2015 10:59:01
|
rheinrichs
Power User
Joined: 08/05/2009 10:05:36
Messages: 209
Offline
|
There is only a dirty way, to implement this (for many cases):
Ask the classloader for a resource path (e.g.):
- this.getClass().getClassLoader().getResource("managebean/dispatcher")
(replace . by /)
You get the URL or the resource. This is a zip or a directory.
Here you can ask for: ".list", to get all packages.
This list can be filtered by the dispatcher-info.xml information's for sub packages.
Enougth about dirty implementations. Maybe you just want to add the subpackages within dispatcher-info.xml ;-)
Kind regards
Roland
|
|
|
19/06/2015 11:16:33
|
dperezlopez
Active
Joined: 23/01/2015 14:55:04
Messages: 18
Offline
|
Precisely I was doing it as you, Roland, mentioned and the result of the filtering was returned in the initRegisteredPackages(...) that Björn introduced.
In development environment it is working fine, nevertheless in the production system we had problems to access the files in that way.
So we had to step back to the manual listing again, what a pity
|
David |
|
|
|