It does do internal redirects for special statuses like 404, at least if you 
configure it to do so.  But the closest you can get to an ad hoc internal 
redirect I think is ns_adp_parse.  Something like:

proc internal_redirect {file_path} {
            ns_return 200 text/html [ns_adp_parse -file $file_path]
}

You'd probably want to terminate processing of the ADP you're in with 
ns_adp_abort (or the Tcl script you're in with return).  I left that out of 
this proc because you might not want that to happen immediately.  You could 
also expand this to source Tcl files too, based on extension.  And if you don't 
recognize the extension you could either error out or serve the file.

Titi Ala'ilima
Lead Architect
MedTouch LLC
1100 Massachusetts Avenue
Cambridge, MA 02138
617.621.8670 x309

From: AOLserver Discussion [mailto:[EMAIL PROTECTED] On Behalf Of Robert Seeger
Sent: Wednesday, March 19, 2008 11:08 PM
To: AOLSERVER@LISTSERV.AOL.COM
Subject: Re: [AOLSERVER] how do I

I've never been fond of the fact that AOLServer has no "internal redirect" 
mechanism.

Rob Seeger

Xavier Bourguignon wrote:

Thanks Don and Darren, I will look at the info.

I just find it strange that I have to REDIRECT to another url, to me

redirect means to go away from the current context to go to another,

usually another domain, but i may be wrong and my understanding needs

to be revised.



Thanks



On 18/03/2008, Xavier Bourguignon <[EMAIL PROTECTED]><mailto:[EMAIL PROTECTED]> 
wrote:



Ok, but what do I do if they do exist? How do I say to aolserver that

 I want to serve the menu.adp file?



 Thank you





 On 18/03/2008, Don Baccus <[EMAIL PROTECTED]><mailto:[EMAIL PROTECTED]> wrote:

 > On Mar 18, 2008, at 11:25 AM, Xavier Bourguignon wrote:

 >  >

 >  >

 >  > I have a URL mapped to a Tcl procedure like this: ns_register_proc

 >  > POST /login login

 >  >

 >  > in my adp page called index.adp I have this:

 >  > <form action ="/login" method="post">

 >  >    username: <input type="text" name="username"><br>

 >  >    password: <input type="password" name="password"><br>

 >  >    <input type="submit" name="submit" value="Login">

 >  > </form>

 >  >

 >  > In one of my Tcl file, I have a procedure called login. This procedure

 >  > gets called once the submit button is clicked. This procedure gets the

 >  > username and password from the form and processese them to check that

 >  > the username/password combination exists in the database.

 >  > If it does then I want to show the menu.adp page, if not, I want to

 >  > show the index.adp page again.

 >

 >

 > Look here: http://panoptic.com/wiki/aolserver/Ns_returnredirect

 >

 >  ns_returnredirect foo

 >

 >  tells the browser to redirect to the URL foo

 >

 >

 >

 >  --

 >  AOLserver - http://www.aolserver.com/

 >

 >  To Remove yourself from this list, simply send an email to <[EMAIL 
 > PROTECTED]><mailto:[EMAIL PROTECTED]> with the

 >  body of "SIGNOFF AOLSERVER" in the email message. You can leave the 
 > Subject: field of your email blank.

 >







--



Xavier Bourguignon















--

AOLserver - http://www.aolserver.com/



To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> 
with the

body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
field of your email blank.


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> 
with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
field of your email blank.

Reply via email to