You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Bruce Altner <ba...@hq.nasa.gov> on 2002/01/08 01:02:44 UTC

URL rewriting mangles call to cgi program

Greetings:

For a number of reasons not worth discussing here, my Login.vm  has to 
first call a cgi script on a remote server before passing to LoginUser 
action. The abbreviated form goes something like this:

<FORM  METHOD="POST" ACTION="http://<server-name>/cgi-bin/acec"
                  onSubmit="this.pass_url.value=this.pass_url.value + 
'/username/' + this.username.value">
...
<INPUT NAME="pass_url" 
VALUE="$link.setPage("OK.vm").setAction("LoginUser")" TYPE="hidden">
...

With cookies enables this works great, the cgi binary acec executes and 
passes the username to LoginUser (no password is needed) where normal 
Turbine authentication takes place, and the user sees the output of OK.vm 
with hasLoggedIn()=true.

With cookies off, however, I get very strange behavior: Turbine adds a 
session ID where I used $link.setAction(), as expected
( <INPUT NAME="pass_url" 
VALUE="<server-name>/app/servlet/Turbine/template/OK.vm/action/LoginUser;jsessionid=B665555775C35043A5B9A791C4333251" 
TYPE="hidden">)

but it also apparently does some URL rewriting on the cgi-call, because 
it  replaces the name of the cgi program itself with the session ID, giving 
me this error.

The requested URL 
/cgi-bin/B665555775C35043A5B9A791C4333251/username/baltner was not found on 
this server.

Is it Turbine or Velocity that is mangling the target of the form action? 
How do I prevent this?

Thanks,
Bruce


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: URL rewriting mangles call to cgi program

Posted by John McNally <jm...@collab.net>.
I do not see how turbine or velocity could cause this behavior.  But you
should be able to look at the page source from the browser and see if
the url is actually mangled.  Not sure if this could be anything, but
have you made sure the semicolon in the url is not messing up some of
your javascript?

john mcnally 

Bruce Altner wrote:
> 
> Greetings:
> 
> For a number of reasons not worth discussing here, my Login.vm  has to
> first call a cgi script on a remote server before passing to LoginUser
> action. The abbreviated form goes something like this:
> 
> <FORM  METHOD="POST" ACTION="http://<server-name>/cgi-bin/acec"
>                   onSubmit="this.pass_url.value=this.pass_url.value +
> '/username/' + this.username.value">
> ...
> <INPUT NAME="pass_url"
> VALUE="$link.setPage("OK.vm").setAction("LoginUser")" TYPE="hidden">
> ...
> 
> With cookies enables this works great, the cgi binary acec executes and
> passes the username to LoginUser (no password is needed) where normal
> Turbine authentication takes place, and the user sees the output of OK.vm
> with hasLoggedIn()=true.
> 
> With cookies off, however, I get very strange behavior: Turbine adds a
> session ID where I used $link.setAction(), as expected
> ( <INPUT NAME="pass_url"
> VALUE="<server-name>/app/servlet/Turbine/template/OK.vm/action/LoginUser;jsessionid=B665555775C35043A5B9A791C4333251"
> TYPE="hidden">)
> 
> but it also apparently does some URL rewriting on the cgi-call, because
> it  replaces the name of the cgi program itself with the session ID, giving
> me this error.
> 
> The requested URL
> /cgi-bin/B665555775C35043A5B9A791C4333251/username/baltner was not found on
> this server.
> 
> Is it Turbine or Velocity that is mangling the target of the form action?
> How do I prevent this?
> 
> Thanks,
> Bruce
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>