I see; you want the cgi program to be executed on the server to render  
that content.  You're right -- there's no simple way in Mason to ask  
apache to serve + process that file.

I see 2 possible solutions.  If the cgi program is written in Perl,  
and you don't mind "porting" it to run under Mason, you could take the  
guts of it and put them in the %init section of a new Mason component,  
and then just call that component.  This is the most "masonesque"  
choice, and probably the one I would choose unless there was a real  
issue of maintaining the legacy cgi-bin version for some reason.

If on the other hand you really just want to call the cgi program  
through the web server, as if you were an end-user client, and then  
incorporate the results into your page, you could write a component  
like this:

<%init>
use LWP::Simple;
my $content = get("http://localhost/cgi-bin/mything";);
</%init>
<% $content %>

This would fetch the content from your webserver (or any other) and  
incorporate the results as though they came from this component.

--Mark

On Sep 6, 2009, at 7:36 PM, John M. Dlugosz wrote:

> Mark Torrance mark-at-vinq.com |mason mailing list| wrote:
>> You probably have your apache handler set up to process only .html
>> files, or only .mhtml files.  You should instead configure it to
>> handle anything within the Location that contains your Mason page.
>> That will let it process these included components.
>>
>> --Mark
>>
>
> No, the cgi stuff is set up correctly.  The URL by itself, or in a SSI
> directive on a SHMTL page, does cause the script to run.  I'm thinking
> the <% mechanism just grabs the text file, and doesn't ask Apache to
> "serve" it.
>
> Even if there's no fancy tag syntax for including components based on
> something other than Mason, shouldn't there be an efficient method  
> of a
> Perl object somewhere that can be called?  Anything's better than  
> having
> Perl do a GET from localhost.  I think the apache modules must  
> include a
> shortcut that receives the Apache-processed page through a stream.
>
> --John
>
>
>
>
>> On Sep 6, 2009, at 6:38 PM, John M. Dlugosz wrote:
>>
>>> Mark Torrance mark-at-vinq.com |mason mailing list| wrote:
>>>> If your main page is being processed by Mason, you can include a
>>>> subpage or subcomponent using the <& ... &> syntax, as in the
>>>> following example:
>>>
>>> That includes the text of the perl program, but does not run it!
>>> It appears to directly include the text, possibly with Mason tags,  
>>> but
>>> bypasses the Apache "Handler" mechanism completely.
>>>
>>> I know how to use Mason components, and my page is built that way.
>>>
>>> --John
>>>
>>>>
>>>> index.html
>>>> <head>
>>>> <link rel="stylesheet" href="style.css">
>>>> </head>
>>>> <body>
>>>> Hello, this is the main page, it has some <% "Mas" . "on" %>  
>>>> embedded
>>>> in it
>>>> <& leftnav &>
>>>> This is the rest of the main page
>>>> </body>
>>>>
>>>> leftnav
>>>> <div class="leftnav">
>>>> My leftnav is here
>>>> It uses Mason <% 2 - 1 %> time
>>>> </div>
>>>>
>>>> style.css
>>>> .leftnav {
>>>> float: left;
>>>> width: 180px;
>>>> }
>>>>
>>>>
>>>>
>>>>
>>>> On Sep 5, 2009, at 9:08 PM, John M. Dlugosz wrote:
>>>>
>>>>> You know what
>>>>>
>>>>> <!--#include virtual="/cgi-bin/blahblah" -->
>>>>>
>>>>> does using Server Side Includes / SS Parsing?
>>>>>
>>>>> How do I do the same thing from a Mason page?
>>>>>
>>>>> I thought I remembered a command that mentioned that it did the  
>>>>> same
>>>>> thing, but now I can't find anything like that in the manual.
>>>>>
>>>>> --John
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>>
>>>>>
>>>>> Let Crystal Reports handle the reporting - Free Crystal Reports  
>>>>> 2008
>>>>> 30-Day
>>>>> trial. Simplify your report design, integration and deployment -  
>>>>> and
>>>>> focus on
>>>>> what you do best, core application coding. Discover what's new  
>>>>> with
>>>>> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
>>>>> _______________________________________________
>>>>> Mason-users mailing list
>>>>> Mason-users@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/mason-users
>>>>
>>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>>
>>> Let Crystal Reports handle the reporting - Free Crystal Reports 2008
>>> 30-Day
>>> trial. Simplify your report design, integration and deployment - and
>>> focus on
>>> what you do best, core application coding. Discover what's new with
>>> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
>>> _______________________________________________
>>> Mason-users mailing list
>>> Mason-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/mason-users
>>
>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008  
> 30-Day
> trial. Simplify your report design, integration and deployment - and  
> focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Mason-users mailing list
> Mason-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mason-users


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to