URLParameter

How do I test (debug) URLParameter?

What do you mean ?

Add parameters to the URL:

http://127.0.0.1:8080/?key=value&key2=value2

Make sure you use EncodeURLComponent on the values.

A URLParameter is an optional parameter add to a URL for example:

www.jimasmith.com/task.cgi?backup

Which the web application will see and take appropriate action.

Did not compete the reply.

When you run normally you add the parm to the url in the browser.

How do you add the parm when you run in debug mode?

[quote=138827:@Jim Smith]Did not compete the reply.

When you run normally you add the parm to the url in the browser.

How do you add the parm when you run in debug mode?[/quote]

Open a new browser window or tab, and enter the URL like Greg says :

http://127.0.0.1:8080/?key=value&key2=value2

Do not close the browser opened upon run or change the URL there, it would stop the app.

WOW! Simple. Thanks.

[quote=138830:@Michel Bujardet]Open a new browser window or tab, and enter the URL like Greg says :

http://127.0.0.1:8080/?key=value&key2=value2
Do not close the browser opened upon run or change the URL there, it would stop the app.[/quote]

When I do this, my web app opens and shows the correct page based on the URLParameter, but it can’t connect to my database server, which is local to my laptop (via localhost).

Is there a way around this, or would I have to access my regular database sever which has a “real” IP address?

[quote=217746:@John McKernon]When I do this, my web app opens and shows the correct page based on the URLParameter, but it can’t connect to my database server, which is local to my laptop (via localhost).

Is there a way around this, or would I have to access my regular database sever which has a “real” IP address?[/quote]

Where are you opening the database ? It should be opened in Session if you want to jump to other pages than the default one.

I’m opening it in Session.Open, either before or after getting URLParameter.

Here’s a code snippet, this code is in very short method (and yes, this is all the code) that’s called right at the beginning of Session.Open:

sub OpenDB
dim db as new CubeSQLServer

db.Host="localhost"
db.UserName = "admin"
db.Password = "admin"
db.Port=4430
db.DatabaseName = "Cube mckern5_lwdb.sqlite"

if db.Connect then <==== This fails if there is a URLParameter, otherwise it works fine
return db
else
return nil

It doesn’t matter whether the DB method is called before or after I get the URLParameter stuff.

This is beginning to feel like a bug, this is in 2015 r2.3

After the db.connect line, what’s the value of db.ErrorMessage?

I can’t believe I didn’t think of checking such an obvious thing…:frowning:

The message is “the maximum number of allowed connections has been reached”.

This is happening because the only way I know of to test URLParameter is to launch my web app (which opens a session on the browser), then open a second tab in my web browser and enter the URL with it’s parameters. The original session has a DB connection, so opening a second session goes over the DB’s limit.

What’s interesting now is that I thought CubeSQL supported multiple users, but evidently that’s not true when it’s on localhost? Time to do some digging…

Thanks!