Sorry was being mighty dense! Anyway, there still seem to be the problem 
(WAnchor/bookmarkURL) as indicated in the "refresing session" email last 
night. Here is another example:

Assuming the code:
----------------------------
#include <Wt/WApplication>
#include <Wt/WLogger>
#include <Wt/WAnchor>

#ifndef TEST_H_
#define TEST_H_

using namespace Wt;

class test : public WApplication {
public:
    test(const WEnvironment& env);
    virtual ~test();

private:
    void parsePath(std::string prefix);

};

#endif /* TEST_H_ */

test::test(const WEnvironment& env) :
    WApplication(env) {
    internalPathChanged.connect(SLOT(this, test::parsePath));
    new WAnchor(bookmarkUrl("/test/click/"), "link", root());
}

test::~test() {
}

void test::parsePath(std::string prefix) {
    log("prefix") << prefix;
}

WApplication *createApplication(const WEnvironment& env) {
    return new test(env);
}

int main(int argc, char **argv) {
    return WRun(argc, argv, &createApplication);
}
----------------------------

starting with code: ./test --docroot=. --http-address=0.0.0.0 
--http-port=8080 --config=wt_config.xml --deploy-path=/test

u: user input
a: returned address bar
 > log

With JS & Cookies...

u: http://0.0.0.0:8080/test#/test/path
a: http://0.0.0.0:8080/test#/test/path
 >
[2008-Dec-03 14:21:03.689095] 23524 [/test IQ4ZUmf2U4O5P4G8] [notice] 
"Session created (#sessions = 1)"
127.0.0.1 - - [2008-Dec-03 14:21:03.690568] "GET /test HTTP/1.1" 200 1631
[2008-Dec-03 14:21:03.723372] 23524 [/test IQ4ZUmf2U4O5P4G8] [prefix] "/"
[2008-Dec-03 14:21:03.723803] 23524 [/test IQ4ZUmf2U4O5P4G8] [prefix] 
"/test/"
[2008-Dec-03 14:21:03.724025] 23524 [/test IQ4ZUmf2U4O5P4G8] [prefix] 
"/test/path/"
127.0.0.1 - - [2008-Dec-03 14:21:03.728617] "GET 
/test?wtd=IQ4ZUmf2U4O5P4G8&_=%2Ftest%2Fpath&js=yes&ajax=yes&request=script&rand=1139361062
 
HTTP/1.1" 200 9040
127.0.0.1 - - [2008-Dec-03 14:21:03.904993] "POST 
/test?wtd=IQ4ZUmf2U4O5P4G8&rand=90221 HTTP/1.1" 200 176

u: http://0.0.0.0:8080/test#/retest/path
a: http://0.0.0.0:8080/test#/retest/path
 >
[2008-Dec-03 14:21:53.894961] 23524 [/test IQ4ZUmf2U4O5P4G8] [prefix] 
"/"127.0.0.1 - - [2008-Dec-03 14:21:53.895710] "POST 
/test?wtd=IQ4ZUmf2U4O5P4G8&rand=49253 HTTP/1.1" 200 24
[2008-Dec-03 14:21:53.895401] 23524 [/test IQ4ZUmf2U4O5P4G8] [prefix] 
"/retest/"
[2008-Dec-03 14:21:53.895429] 23524 [/test IQ4ZUmf2U4O5P4G8] [prefix] 
"/retest/path/"

u: Click Link
a: http://0.0.0.0:8080/test/test/click/
 >
[2008-Dec-03 14:23:19.619314] 23524 [/test IQ4ZUmf2U4O5P4G8] [notice] 
"Refreshing session"
127.0.0.1 - - [2008-Dec-03 14:23:19.620306] "GET /test/test/click/ 
HTTP/1.1" 200 1628
[2008-Dec-03 14:23:19.703767] 23524 [/test IQ4ZUmf2U4O5P4G8] [prefix] "/"
[2008-Dec-03 14:23:19.704475] 23524 [/test IQ4ZUmf2U4O5P4G8] [prefix] 
"/test/"
[2008-Dec-03 14:23:19.704508] 23524 [/test IQ4ZUmf2U4O5P4G8] [prefix] 
"/test/click/"
127.0.0.1 - - [2008-Dec-03 14:23:19.708738] "GET 
/test/test/click/?wtd=IQ4ZUmf2U4O5P4G8&js=yes&ajax=yes&request=script&rand=1617829768
 
HTTP/1.1" 200 9031
127.0.0.1 - - [2008-Dec-03 14:23:19.896953] "POST 
/test/test/click/?wtd=IQ4ZUmf2U4O5P4G8&rand=17487 HTTP/1.1" 200 176

u: Click Link
a: http://0.0.0.0:8080/test/test/click/test/test/click/
 >
[2008-Dec-03 14:24:36.740135] 23524 [/test IQ4ZUmf2U4O5P4G8] [notice] 
"Refreshing session"
127.0.0.1 - - [2008-Dec-03 14:24:36.741141] "GET 
/test/test/click/test/test/click/ HTTP/1.1" 200 1630
127.0.0.1 - - [2008-Dec-03 14:24:36.828021] "GET 
/test/test/click/test/test/click/?wtd=IQ4ZUmf2U4O5P4G8&js=yes&ajax=yes&request=script&rand=1143413966
 
HTTP/1.1" 200 9033
[2008-Dec-03 14:24:36.823931] 23524 [/test IQ4ZUmf2U4O5P4G8] [prefix] 
"/test/click/"
[2008-Dec-03 14:24:36.823995] 23524 [/test IQ4ZUmf2U4O5P4G8] [prefix] 
"/test/click/test/"
[2008-Dec-03 14:24:36.824021] 23524 [/test IQ4ZUmf2U4O5P4G8] [prefix] 
"/test/click/test/test/"
[2008-Dec-03 14:24:36.824044] 23524 [/test IQ4ZUmf2U4O5P4G8] [prefix] 
"/test/click/test/test/click/"
127.0.0.1 - - [2008-Dec-03 14:24:37.036425] "POST 
/test/test/click/test/test/click/?wtd=IQ4ZUmf2U4O5P4G8&rand=3179 
HTTP/1.1" 200 177

With JS & No Cookies

u: http://0.0.0.0:8080/test#/test/path
a: http://0.0.0.0:8080/test?wtd=Jn5EzDavtNBIIntz#/test/path/
 >
[2008-Dec-03 14:30:20.395778] 23694 [/test Jn5EzDavtNBIIntz] [notice] 
"Session created (#sessions = 1)"
127.0.0.1 - - [2008-Dec-03 14:30:20.397322] "GET /test HTTP/1.1" 200 1626
127.0.0.1 - - [2008-Dec-03 14:30:20.536384] "GET 
/test?wtd=Jn5EzDavtNBIIntz HTTP/1.1" 200 1626
[2008-Dec-03 14:30:20.764049] 23694 [/test Jn5EzDavtNBIIntz] [prefix] "/"
[2008-Dec-03 14:30:20.764603] 23694 [/test Jn5EzDavtNBIIntz] [prefix] 
"/test/"
[2008-Dec-03 14:30:20.764830] 23694 [/test Jn5EzDavtNBIIntz] [prefix] 
"/test/path/"
127.0.0.1 - - [2008-Dec-03 14:30:20.769468] "GET 
/test?wtd=Jn5EzDavtNBIIntz&_=%2Ftest%2Fpath%2F&js=yes&ajax=yes&request=script&rand=1480731726
 
HTTP/1.1" 200 9040
127.0.0.1 - - [2008-Dec-03 14:30:20.975806] "POST 
/test?wtd=Jn5EzDavtNBIIntz&rand=7246 HTTP/1.1" 200 176

u: http://0.0.0.0:8080/test?wtd=Jn5EzDavtNBIIntz#/retest/path/
a: http://0.0.0.0:8080/test?wtd=Jn5EzDavtNBIIntz#/retest/path/
 >
[2008-Dec-03 14:32:47.823331] 23694 [/test Jn5EzDavtNBIIntz] [prefix] 
"/"127.0.0.1 - - [2008-Dec-03 14:32:47.824163] "POST 
/test?wtd=Jn5EzDavtNBIIntz&rand=12907 HTTP/1.1" 200 24
[2008-Dec-03 14:32:47.823754] 23694 [/test Jn5EzDavtNBIIntz] [prefix] 
"/retest/"
[2008-Dec-03 14:32:47.823781] 23694 [/test Jn5EzDavtNBIIntz] [prefix] 
"/retest/path/"

u: Click Link
a: http://0.0.0.0:8080/test?wtd=Est1KLDaxNYFiihy#/test/click/
 >
[2008-Dec-03 14:33:30.449499] 23694 [/test Fm5uSwXqlBCU6tqN] [notice] 
"Session created (#sessions = 2)"
127.0.0.1 - - [2008-Dec-03 14:33:30.450696] "GET /test/test/click/ 
HTTP/1.1" 200 1627
127.0.0.1 - - [2008-Dec-03 14:33:30.544282] "GET 
/test/test/click/?wtd=Fm5uSwXqlBCU6tqN HTTP/1.1" 200 1625
[2008-Dec-03 14:33:30.791447] 23694 [/test Fm5uSwXqlBCU6tqN] [notice] 
"Redirecting to canonical URL: /test#/test/click/"
127.0.0.1 - - [2008-Dec-03 14:33:30.792323] "GET 
/test/test/click/?wtd=Fm5uSwXqlBCU6tqN&js=yes&ajax=yes&request=script&rand=324705063
 
HTTP/1.1" 200 85
[2008-Dec-03 14:33:30.792744] 23694 [/test Fm5uSwXqlBCU6tqN] [notice] 
"Session destroyed (#sessions = 1)"
[2008-Dec-03 14:33:30.827122] 23694 [/test Est1KLDaxNYFiihy] [notice] 
"Session created (#sessions = 2)"
127.0.0.1 - - [2008-Dec-03 14:33:30.828301] "GET /test HTTP/1.1" 200 1625
127.0.0.1 - - [2008-Dec-03 14:33:31.045156] "GET 
/test?wtd=Est1KLDaxNYFiihy HTTP/1.1" 200 1628
[2008-Dec-03 14:33:31.296091] 23694 [/test Est1KLDaxNYFiihy] [prefix] "/"
[2008-Dec-03 14:33:31.296606] 23694 [/test Est1KLDaxNYFiihy] [prefix] 
"/test/"
[2008-Dec-03 14:33:31.296810] 23694 [/test Est1KLDaxNYFiihy] [prefix] 
"/test/click/"
127.0.0.1 - - [2008-Dec-03 14:33:31.301212] "GET 
/test?wtd=Est1KLDaxNYFiihy&_=%2Ftest%2Fclick%2F&js=yes&ajax=yes&request=script&rand=1170914599
 
HTTP/1.1" 200 9034
127.0.0.1 - - [2008-Dec-03 14:33:31.540831] "POST 
/test?wtd=Est1KLDaxNYFiihy&rand=78558 HTTP/1.1" 200 177

u: Click Link
a: http://0.0.0.0:8080/test?wtd=xWaYheCjSznPjJxK#/test/click/
 >
[2008-Dec-03 14:34:30.323400] 23694 [/test pfFZsY1uF7JDIchz] [notice] 
"Session created (#sessions = 3)"
127.0.0.1 - - [2008-Dec-03 14:34:30.324546] "GET /test/test/click/ 
HTTP/1.1" 200 1626
127.0.0.1 - - [2008-Dec-03 14:34:30.409979] "GET 
/test/test/click/?wtd=pfFZsY1uF7JDIchz HTTP/1.1" 200 1624
[2008-Dec-03 14:34:30.639446] 23694 [/test pfFZsY1uF7JDIchz] [notice] 
"Redirecting to canonical URL: /test#/test/click/"
127.0.0.1 - - [2008-Dec-03 14:34:30.640244] "GET 
/test/test/click/?wtd=pfFZsY1uF7JDIchz&js=yes&ajax=yes&request=script&rand=220620246
 
HTTP/1.1" 200 85
[2008-Dec-03 14:34:30.640472] 23694 [/test pfFZsY1uF7JDIchz] [notice] 
"Session destroyed (#sessions = 2)"
[2008-Dec-03 14:34:30.669904] 23694 [/test xWaYheCjSznPjJxK] [notice] 
"Session created (#sessions = 3)"
127.0.0.1 - - [2008-Dec-03 14:34:30.671026] "GET /test HTTP/1.1" 200 1625
127.0.0.1 - - [2008-Dec-03 14:34:30.899397] "GET 
/test?wtd=xWaYheCjSznPjJxK HTTP/1.1" 200 1626
[2008-Dec-03 14:34:31.116054] 23694 [/test xWaYheCjSznPjJxK] [prefix] "/"
[2008-Dec-03 14:34:31.116560] 23694 [/test xWaYheCjSznPjJxK] [prefix] 
"/test/"
[2008-Dec-03 14:34:31.116761] 23694 [/test xWaYheCjSznPjJxK] [prefix] 
"/test/click/"
127.0.0.1 - - [2008-Dec-03 14:34:31.121128] "GET 
/test?wtd=xWaYheCjSznPjJxK&_=%2Ftest%2Fclick%2F&js=yes&ajax=yes&request=script&rand=389217182
 
HTTP/1.1" 200 9038
127.0.0.1 - - [2008-Dec-03 14:34:31.351212] "POST 
/test?wtd=xWaYheCjSznPjJxK&rand=22377 HTTP/1.1" 200 177

Again, this all seems quite inconsistent...
With cookies the second link click causes the repetition of the path. 
Without it does not.
When no cookies the session is not appended to the link (should we be 
doing this? and if so i feel there should be another internal helper 
function that adds the session-id when it's needed (the non-cookie case) 
but not when not.)
Also should the link not make use of the aforentioned anchor trick? I.e. 
producing the link as: "test#/test/path"

I am sorry about all this by the way, but i am really trying to make use 
of wt :)

Roja

Koen Deforche wrote:
> Hey Anthony,
>
> 2008/12/3 roja <[EMAIL PROTECTED]>:
>   
>> Cheers for sorting all this :) Out of interest is there an easy way of
>> causing the wthttp to deploy the application with a name i.e.
>>
>> http://0.0.0.0:8080/name
>>     
>
> You can use: --deploy-path=/name ?
>
>   
>> Also, is there anywhere on the roadmap where the system will shift to using 
>> simply urls (i.e. http://0.0.0.0:8080/internal/path/goes/here)?
>>     
>
> When deploying like you indicate above, the internal path URLs will be
> of the form:
>
> http://0.0.0.0:8080/name/internal/path/goes/here
>
> (instead of ?_=/...)
>
> But the displayed URL will still be:
>
> http://0.0.0.0:8080/name#/internal/path/goes/here
>
> The reason is that you cannot change the url without doing a full page
> reload, unless you only change behind the '#' (originally used for
> named anchors). This anchor trick is becoming very popular for AJAX
> applications.
>
> If you do not mind full page reloads (and possibly new sessions), then
> you could still use Wt although you lose the interactivity advantage.
> Then we would probably want to add a configuration option where you
> disable the 'canonical url redirection' that redirects the user to a
> URL with the '#' notation for internal paths ?
>
> Regards,
> koen
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> witty-interest mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/witty-interest
>   


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to