|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
Serving a static documentHello, I’m quite new to Catalyst so apologies if this is a
naive question. I’m trying to create a KML document within catalyst and
then redirect the server to that document. The problem I’m having is that
Catalyst seems to be interpreting the URL of the document (e.g. http://localhost:3000/root/src/test.kml)
as a call to a script which it doesn’t recognise and so it reverts to the
default page. How do I override this behaviour? Thanks,
Matt. _______________________________________________ List: Catalyst@... Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@.../ Dev site: http://dev.catalyst.perl.org/ |
|
|
Re: Serving a static documentOn 02/10/2009, at 9:13 PM, matthew couchman (JIC) wrote: > Hello, > > I'm quite new to Catalyst so apologies if this is a naive question. > I'm trying to create a KML document within catalyst and then > redirect the server to that document. The problem I'm having is that > Catalyst seems to be interpreting the URL of the document (e.g. http://localhost:3000/root/src/test.kml) > as a call to a script which it doesn't recognise and so it reverts > to the default page. How do I override this behaviour? > Something like this (untested): sub thing :Path('test.kml') { my ($self, $c) = @_; $c->serve_static_file('relative/path/from/app/root/to/test.kml'); } or similar. Catalyst::Plugin::Static::Simple does the dirty work for you. _______________________________________________ List: Catalyst@... Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@.../ Dev site: http://dev.catalyst.perl.org/ |
|
|
RE: Serving a static documentThanks, I didn't know about Catalyst::Plugin::Static::Simple but that looks like just what I am after.
> -----Original Message----- > From: Kieren Diment [mailto:diment@...] > Sent: 02 October 2009 12:28 > To: The elegant MVC web framework > Subject: Re: [Catalyst] Serving a static document > > > On 02/10/2009, at 9:13 PM, matthew couchman (JIC) wrote: > > > Hello, > > > > I'm quite new to Catalyst so apologies if this is a naive question. > > I'm trying to create a KML document within catalyst and then > > redirect the server to that document. The problem I'm having is that > > Catalyst seems to be interpreting the URL of the document (e.g. > http://localhost:3000/root/src/test.kml) > > as a call to a script which it doesn't recognise and so it reverts > > to the default page. How do I override this behaviour? > > > > Something like this (untested): > > sub thing :Path('test.kml') { > my ($self, $c) = @_; > $c->serve_static_file('relative/path/from/app/root/to/test.kml'); > } > > or similar. Catalyst::Plugin::Static::Simple does the dirty work for > you. > > > _______________________________________________ > List: Catalyst@... > Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst > Searchable archive: http://www.mail- > archive.com/catalyst@.../ > Dev site: http://dev.catalyst.perl.org/ _______________________________________________ List: Catalyst@... Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@.../ Dev site: http://dev.catalyst.perl.org/ |
| Free embeddable forum powered by Nabble | Forum Help |