Andrew Ho wrote: > > Hello, > > AH>...can you call an Apache::ASP page from an Apache::Registry script? > AH>Couched in MVC terminology, can I forward control from a .pl controller > AH>to a .asp template, and pass arguments in a natural way? > > JC>The safest thing to do right now would probably be to do an external > JC>redirect to the ASP page like: > JC> Apache->request->header_out('Location', "script.asp?$ARGS"); > > Thanks for the quick response. I didn't think of the POST data reading > conflict. A related question, is there any way to make Apache::ASP not > initialize its $Request object by default? This is the only blocker from > using the Apache::Request API in an Apache::ASP page. >
Not at this time. If you really need it, we could probably create a config to support this. Otherwise, you might be able to do something like create your own subclass off of Apache::ASP, and override your own handler() subroutine to call something like: package My::Apache::ASP; sub handler { local *Apache::ASP::Request::new = sub { bless {}, 'Apache::ASP::Request' }; &Apache::ASP::hander(); } 1; I don't really know if it would work, but you could try an approach like this. > Specifically what I'm trying to do is to emulate $Server->Transfer but > from an Apache::Registry script. I don't need to further process the > Apache::ASP template in the Apache::Registry script. > > I think an .asp that has <% at the top of the file and %> at the end of it > would be similar; but I'd prefer using Apache::Registry to (1) eliminate > the <% %> tokens and more importantly (2) continue using the > Apache::Request interface which I'm used to. > One thing I have considered doing is allowing a CGIScript 1 type of config to be set that would autowrap scripts in <% %> for you. It may be that you can program Apache::Request in ASP script just fine. I have done a lot of work to make CGI.pm based script work in ASP, but not Apache::Request, so no gaurantees, but I know that when the ASP api does not support something directly, I will sometimes go to the Apache API off of Apache->request. > I've been investigating other template systems to try to find similar > functionality in an existing package for a non-Tellme related project and > haven't been able to find any embedded-Perl solutions that can be called > from a .pl and still have the benefits of template caching. I prefer > embedded Perl because it's so convenient for little niceties (for example, > "Your search found <%= $n || 'no' %> document<%= $n == 1 ? '' : 's' %>.") > that real-world HTML interfaces need. > Like Perrin suggested, Template Toolkit was built to be more of a plugin whereever you want a template, so might work better for you. Apache::ASP is its own enclose execution environment, and takes more of the things for you. -- Josh _________________________________________________________________ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com 1-714-625-4051 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]