Apache::ASP and Apache::Sandwich

2001-02-24 Thread Joseph Mallett

If you look at http://www.jmallett.org/asp/env.asp, you will see the ASP
code that SHOULD appear sandwiched between my rtop and bottom headers, but
it isn't getting processed. I want to filter the top and bottom sandwiches
through Apache::ASP, then put them together, and filter out any asp that's
left. Any ideas how this can be accomplished?

/joseph

--
Joseph Mallett
+1 919 349 2976
6709 Valley Woods Ln
Apex NC 27502
http://newgold.net/
http://xMach.org/




Re: Apache::ASP and Apache::Sandwich

2001-02-24 Thread Joshua Chamas

Joseph Mallett wrote:
 
 If you look at http://www.jmallett.org/asp/env.asp, you will see the ASP
 code that SHOULD appear sandwiched between my rtop and bottom headers, but
 it isn't getting processed. I want to filter the top and bottom sandwiches
 through Apache::ASP, then put them together, and filter out any asp that's
 left. Any ideas how this can be accomplished?
 

You can use the Apache::ASP event model to create your own sandwiches.
Just include the headers and footers...

# in global.asa
sub Script_OnStart { $Response-Include("header.inc"); }
sub Script_OnEnd   { $Response-Include("footer.inc"); }

The header and footer may be in your local directories,
Global directory, or IncludesDir directories.

From the perldoc on Apache::Sandwidch, it seems like you could also:

# in global.asa
sub Script_OnStart { Apache::Sandwidch::insert_parts('HEADER') }
sub Script_OnEnd   { Apache::Sandwidch::insert_parts('FOOTER') }

or in your Apache::ASP script:
## ASP Script
Apache::Sandwidch::insert_parts('HEADER');
  # content here
Apache::Sandwidch::insert_parts('FOOTER');

Just as in perl itself, TIMTOWTDI :)

If you are performance minded, the first method is likely the 
best, as page will be served by only one Apache::ASP request,
where as in the Apache::Sandwich model, you'd have 3 apache
requests per page served.  Apache::ASP includes get compiled
as perl code, so get served very very fast, especially if you
precompile the site with Apache::ASP-Loader()

--Josh

_
Joshua Chamas   Chamas Enterprises Inc.
NodeWorks  free web link monitoring   Huntington Beach, CA  USA 
http://www.nodeworks.com1-714-625-4051