I'm wondering if there is also other way how to configure request
dispatching. I'm trying to play with Induction, but for my project I
need to configure request dispatching at startup (and I can very easy
connect controller with action string).
This question is related to all xml-based configuration.
Thanks
- Petr
I've had some experience with Induction and would like to help you if
I can. But I don't quite understand what you are asking.
In what way do you need to configure requests dispatching?
What specifically are you trying to do?
david
thanks for reply.
Firstly I'd like to specify what I'm doing. I'd like to
programmaticaly setup url resolving on application startup. The URL
resolving is based on servlet configuration, but it's not Induction
configuration (it's our framework configuration). In fact I have some
code written and I'm trying to make it working with Induction
(hopefully there are only few web pages, because I wrote mainly web
services in past).
My URL resolver is very simple, I have modules that are scanned when
application starts and each module is traversed at the startup time so
it can add URL/Controller pair to the application. It's no problem for
me to write such Container because it's de-facto Map<String, String>.
I will start to use way #1, which seems to me less complicated at the
beginning. I'm new to Induction so it will take some time to
understand core concepts. I'm also at framework evaluating phase so
I'm trying Induction possibilities:)
Thanks
- Petr
On Feb 23, 9:58 am, Adinath <adin...@acciente.com> wrote:
> Petr,
>
> There are 2 different ways I can interpret your question, so I will try to
> cover both.
>
> Controlling the URL dispatch mechanism
> ==============================
> URL dispatching is also controlled via plug-ins known as *resolvers* in
> Induction (http://www.inductionframework.org/using-resolvers-1-tutorial.html).
> There are 2 resolver interfaces used to control URL dispatching:
>
> com.acciente.induction.resolver.ControllerResolver and
> com.acciente.induction.resolver.ViewResolver
>
> An HTTP request is first sent to the ControllerResolver and if that returns
> a null resolution, the HTTP request is sent to the ViewResolver.
>
> The default resolver implementation provided for these resolvers are known
> as the ShortURL resolvers. You can easily write your own resolvers by
> implementing the above interfaces and specifying the custom resolver
> implementation classnames in your Induction XML using the directives shown
> below:
>
> <config>
>
> ...other config stuff....
>
> <controller-resolver>
>
> <class>the_name_of_a_class_that_implements_a_controller_resolver</class>
> </controller-resolver>
>
> <view-resolver>
> <class>the_name_of_a_class_that_implements_a_view_resolver</class>
> </view-resolver>
> ...other config stuff....
>
> </config>
>
> Note that the resolvers classes you write can have injected into their
> constructor via injection, just by declaring a constructor parameter of the
> respective type, the types documented here:http://www.inductionframework.org/param-injection-2-reference.html#Co...
> * <init-param>
> <param-name>config-loader-class</param-name>
>
> <param-value>com.yourpackage.YourClassThatImplementsConfigLoader</param-value>
> </init-param>
> * </servlet>