transport.requestPath includes the first path element

1 view
Skip to first unread message

Steve Weller

unread,
Feb 22, 2010, 10:48:44 PM2/22/10
to Bombax Support
The docs say:

A convenience variable containing the document URI without your
BxApp's leading location. For example, if your BxApp is located at "/
example" so that all requests that start with http://example.com/example/
are routed to your BxApp, if http://www.example.com/example/app/save?x=1
is accessed, requestPath will be "app/save"

However, at least in debug mode, this is not the case. The request
path I am seeing in my application is /example/app/save and hence I am
getting the "site" name twice.

What is the designed behavior?

Dominic Blais

unread,
Feb 22, 2010, 11:09:24 PM2/22/10
to bombax-...@googlegroups.com
This is the behavior we were intending for the following reason: the BxApp 'knows' what the path prefix is because it is assigned and passed by Bombax.app.  In debug mode, there is no prefix passed as Xcode rather than Bombax.app launches your BxApp thus no prefix is removed.  I've added a note about this to API documentation and corrected it to show that the leading forward slash is included.
Thanks,  
Dominic Blais
COO & Hacker-in-Chief


--
You received this message because you are subscribed to the Google Groups "Bombax Support" group.
To post to this group, send email to bombax-...@googlegroups.com.
To unsubscribe from this group, send email to bombax-suppor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/bombax-support?hl=en.


Steve Weller

unread,
Feb 23, 2010, 12:07:00 AM2/23/10
to Bombax Support
That behavior is confusing.

My application should not care about the prefix, but this is not
possible because I have to create absolute URLs.

I at least need to know that it is present (so I can strip it), but
would prefer to just know what it is so I can add it as appropriate.
None of the path matching should include the prefix: this allows me to
deploy the same app under as many prefixes as I want.

I'm also confused about your statement that Xcode does not include the
prefix. If that is the case, then how are my paths that look like "/
site/abc" being matched under the debugger?

On Feb 22, 8:09 pm, Dominic Blais <domi...@bombaxtic.com> wrote:
> This is the behavior we were intending for the following reason: the BxApp
> 'knows' what the path prefix is because it is assigned and passed by
> Bombax.app.  In debug mode, there is no prefix passed as Xcode rather than
> Bombax.app launches your BxApp thus no prefix is removed.  I've added a note
> about this to API documentation and corrected it to show that the leading
> forward slash is included.
> Thanks,
> Dominic Blais
> COO & Hacker-in-Chief
>
>
>
> On Mon, Feb 22, 2010 at 7:48 PM, Steve Weller <bagelt...@gmail.com> wrote:
> > The docs say:
>
> > A convenience variable containing the document URI without your
> > BxApp's leading location. For example, if your BxApp is located at "/

> > example" so that all requests that start withhttp://example.com/example/
> > are routed to your BxApp, ifhttp://www.example.com/example/app/save?x=1


> > is accessed, requestPath will be "app/save"
>
> > However, at least in debug mode, this is not the case. The request
> > path I am seeing in my application is /example/app/save and hence I am
> > getting the "site" name twice.
>
> > What is the designed behavior?
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Bombax Support" group.
> > To post to this group, send email to bombax-...@googlegroups.com.
> > To unsubscribe from this group, send email to

> > bombax-suppor...@googlegroups.com<bombax-support%2Bunsubscribe@go oglegroups.com>

Dominic Blais

unread,
Feb 23, 2010, 12:20:09 AM2/23/10
to bombax-...@googlegroups.com
The idea is to make BxApps relocatable into any folder, server, etc without having to modify their configuration.  In accordance with that goal, a BxApp should run at / in the same way it would run at /site (just like you're suggesting with multiple prefixes).  The situation is similar with the static resource support.  So, ideally what you debug at / you can run /site, etc when deployed.

The trade off is that when you debug it, it is always as if it were 'deployed' to /.  This is because there is no way to debug as if it were configured at /site, etc (actually, you can do it, but it's not supported: just add -root /site to the target arguments).  If needed, you can always get the full prefix with serverVar's DOCUMENT_URI.

HTH,
Dominic Blais
COO & Hacker-in-Chief

To unsubscribe from this group, send email to bombax-suppor...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages