diff Lib/IMPL/Web/Handler/JSONView.pm @ 206:c8fe3f84feba

+IMPL::Web::Handlers::ViewSelector +IMPL::Web::Handlers::ErrorHandler *IMPL::Web::Handlers::RestController moved types mappings to ViewSelector
author sergey
date Thu, 03 May 2012 16:48:39 +0400
parents e743a8481327
children 3cebcf6fdb9b
line wrap: on
line diff
--- a/Lib/IMPL/Web/Handler/JSONView.pm	Thu May 03 01:00:02 2012 +0400
+++ b/Lib/IMPL/Web/Handler/JSONView.pm	Thu May 03 16:48:39 2012 +0400
@@ -11,13 +11,17 @@
 	}
 };
 
+sub contentType {
+	'application/json'
+}
+
 sub Invoke {
 	my ($this,$action,$next) = @_;
 	
-	my $result = $next->($action);
+	my $result = $next ? $next->($action) : undef;
 	$result = [$result] unless ref $result;
 	
-	#$action->response->contentType('text/javascript');
+	$action->response->contentType($this->contentType);
     
     my $hout = $action->response->streamBody;