Thank you for your reply. We allow pages with extensions .csc to be rendered by Mason:
<LocationMatch "\.csc$"> SetHandler perl-script PerlHandler OurApp::Mason </LocationMatch> And, obviously, Apache's DirectoryIndex, so that http://site.com/ would open up http://site.com/index.csc . Then when I wanted to put in a dhandler (for the http://site.com/45), it would return a blank page if the browser did not ask for the .csc filename directly: http://site.com/index.csc would work but http://site.com/ would return a blank page. To add the functionaly of the dhandler, I also typed this out in the Apache config: <Location /> SetHandler perl-script PerlHandler OurApp::Mason </Location> Any ideas as to why it is not recognizing the .csc pages and then opening and displaying them accordingly? Thank you very much Ogden On Thu, 17 Aug 2006, Marius Feraru wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Ogden wrote: > > We have these real URLs: > > http://site.com/ > > http://site.com/shop/ > > http://site.com/about/ > > These work fine and the autohandler does it's job. > > > > Now, we want a dhandler in there so: > > http://site.com/45 > > will pull up something from Postgres with an id of 45. > > > > I am confused as to how to approach this. No matter what I put in > > dhandler, a blank page is returned. > > Any idea as to what I may be doing wrong? > I cannot see any obvious reason for "getting a blank page", at least not > without seeing some code. Anyway, you will fix it in no time thinking > about "dhandlers" as "fall back components". So, your "execution path" > for "/45" would be: > /autohandler -> /dhandler > > For handling the "45" argument, you could use a variation upon > "$m->dhandler_arg" (or "$r->uri" if your prefer). > > Remember to not blindly forward such requests. Validate them, croaking > some error on failure. > > Here's a dummy dhandler example: > > <%init> > # does the request look like "/[ID]"? > if ($m->dhandler_arg =~ /^(\d+)/) { > # ("your_id_handler" should handle "invalid ID" errors) > return $m->comp('your_id_handler', %ARGS, id => $1); > } > > # call 911 or something > $m->auto_send_headers(0); > $m->clear_buffer; > $r->status(404); > $r->content_type('text/plain'); > $r->send_http_header; > $m->print('Are you lost?'); > $m->abort; > </%init> > > cheers > - -- > Marius Feraru > -----BEGIN PGP SIGNATURE----- > > iD8DBQFE5HEOtZHp/AYZiNkRAh7aAKDtJs7MGGfDEtZjCDCLCDZmpiqeGgCgpBGf > HIYwaBMOGqLMe5sj2xde2eg= > =4Jr0 > -----END PGP SIGNATURE----- > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Mason-users mailing list > Mason-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/mason-users > ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users