Return-Path: Delivered-To: apmail-perl-modperl-archive@www.apache.org Received: (qmail 58012 invoked from network); 31 Jul 2009 12:52:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 31 Jul 2009 12:52:18 -0000 Received: (qmail 24056 invoked by uid 500); 31 Jul 2009 12:52:17 -0000 Delivered-To: apmail-perl-modperl-archive@perl.apache.org Received: (qmail 24036 invoked by uid 500); 31 Jul 2009 12:52:17 -0000 Mailing-List: contact modperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list modperl@perl.apache.org Received: (qmail 24028 invoked by uid 99); 31 Jul 2009 12:52:17 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 31 Jul 2009 12:52:17 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of adam.prime@utoronto.ca designates 128.100.132.147 as permitted sender) Received: from [128.100.132.147] (HELO bureau60.ns.utoronto.ca) (128.100.132.147) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 31 Jul 2009 12:52:06 +0000 Received: from [192.168.2.192] (bas6-toronto12-1088883588.dsl.bell.ca [64.231.11.132]) (authenticated bits=0) by bureau60.ns.utoronto.ca (8.13.8/8.13.8) with ESMTP id n6VCpVYv021118 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 31 Jul 2009 08:51:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=utoronto.ca; s=beta; t=1249044695; bh=L7T1cpbZMcnZwsXdwrKDMxYoN92pGS1lFjrM51EFCzQ=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=xmG41k4VKTz5EEfothUox5nM/CcNtQZ6Thn/+c36IsffM6q4yr6+Oz94bqlBVa1PB 07PqnqNjw5qorkfFRgfcH91tvEwlo074NV87oP0btXQg+EsiQ6XIREUa1CTTmOCyft rnk6+91eANsJGUY/7yFt9nfbcekzvBzYmEJm2+B8= Message-ID: <4A72E8CF.6040007@utoronto.ca> Date: Fri, 31 Jul 2009 08:51:27 -0400 From: Adam Prime User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: Sudheer Puppala CC: modperl@perl.apache.org Subject: Re: How to write a handler References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Sudheer Puppala wrote: > Hi > > I am java/flex programmer since 1yrs and a little bit of perl. I have > a requirement of write a > handler at apache http server side using perl. > > Scenario: > > > 1. My flex application request for a particular file to the apache > server. > 2. The server upon receiving a request look for the mime type of the > > file. If that file mime type is video/flv or .flv I should write a handler > for that. > > 3. The handler should be in a position to call a java class. where I will > > decrypt the fille and send it back to the flex application. > > > Here my request is how can I write my own handler? where can I write it? and > as I am not a perl programmer, I am not getting the solution for that. So > could any one help me with an example. I'd start here: http://perl.apache.org/docs/2.0/user/handlers/intro.html to get the headers (including the content-type) from the incoming request: http://perl.apache.org/docs/2.0/api/Apache2/RequestRec.html#C_headers_in_ to run Java code you can look at: http://search.cpan.org/~patl/Inline-Java-0.52/Java.pod Hopefully that should point you in the right direction. Adam