Mercurial > pub > Impl
comparison Lib/IMPL/Web/Handler/RestController.pm @ 401:16ff604298c7
minor fixes
author | cin |
---|---|
date | Thu, 15 May 2014 18:24:28 +0400 |
parents | 71221d79e6b4 |
children |
comparison
equal
deleted
inserted
replaced
400:ef37ec102dab | 401:16ff604298c7 |
---|---|
6 require => { | 6 require => { |
7 Locator => 'IMPL::Web::AutoLocator', | 7 Locator => 'IMPL::Web::AutoLocator', |
8 ResourceInterface => 'IMPL::Web::Application::ResourceInterface', | 8 ResourceInterface => 'IMPL::Web::Application::ResourceInterface', |
9 Exception => 'IMPL::Exception', | 9 Exception => 'IMPL::Exception', |
10 ArgumentExecption => '-IMPL::InvalidArgumentException', | 10 ArgumentExecption => '-IMPL::InvalidArgumentException', |
11 NotFoundException => 'IMPL::Web::NotFoundException' | 11 NotFoundException => 'IMPL::Web::NotFoundException', |
12 Loader => 'IMPL::Code::Loader' | |
12 }, | 13 }, |
13 base => { | 14 base => { |
14 'IMPL::Object' => undef, | 15 'IMPL::Object' => undef, |
15 'IMPL::Object::Autofill' => '@_', | 16 'IMPL::Object::Autofill' => '@_', |
16 'IMPL::Object::Serializable' => undef | 17 'IMPL::Object::Serializable' => undef |
53 | 54 |
54 my $method = $request->requestMethod; | 55 my $method = $request->requestMethod; |
55 | 56 |
56 my @segments = $this->GetResourcePath($request); | 57 my @segments = $this->GetResourcePath($request); |
57 | 58 |
58 my $res = $this->resourceFactory->new( | 59 my $factory = $this->resourceFactory; |
60 | |
61 $factory = Loader->default->Require($factory) | |
62 unless ref($factory) || eval { $factory->can('new') }; | |
63 | |
64 my $res = $factory->new( | |
59 id => 'root', | 65 id => 'root', |
60 request => $request, | 66 request => $request, |
61 location => Locator->new(base => $request->application->baseUrl), | 67 location => Locator->new(base => $request->application->baseUrl), |
62 ); | 68 ); |
63 | 69 |