Project

General

Profile

porgressive bootstrap bug

Added by Daniel Walter about 13 years ago

Hi,

if i unterstand the progressive bootstrap right, first a "normal" html page is rendered without any javascript. if the browser supports, javascript is reloaded. if i call a url like this http://localhost:8080/ANY_URL directly i can see a bugus request in the log output. i think this is the request which should load some javascript thingies.

#include <Wt/WServer>
#include <Wt/WApplication>
#include <Wt/WEnvironment>
#include <Wt/WContainerWidget>
#include <Wt/WLogger>

using namespace Wt;

class ExampleApplication: public WApplication {
public:
    ExampleApplication(const WEnvironment& env)
    :WApplication(env)
    {
        internalPathChanged().connect(this, &ExampleApplication::logInternalPath);
    }

private:
    void logInternalPath(const std::string& path) {
        log("path") << path;
    }
};

WApplication *createWtShowtimeApplication(const WEnvironment& env) {
    return new ExampleApplication(env);
}

int main(int argc, char **argv) {
    try {
        WServer server(argv[0]);
        server.setServerConfiguration(argc, argv, WTHTTP_CONFIGURATION);

        server.addEntryPoint(Application, createWtShowtimeApplication);

        if (server.start()) {
            WServer::waitForShutdown();
            server.stop();
        }
    } catch (Wt::WServer::Exception& e) {
        std::cerr << e.what() << std::endl;
    } catch (std::exception &e) {
        std::cerr << "exception: " << e.what() << std::endl;
    }

}

Reading: /etc/wt/wt_config.xml
[2011-May-05 17:14:17.443811] 28629 - [notice] "Wt: initializing built-in httpd"
[2011-May-05 17:14:17.444008] 28629 - [notice] "Reading Wt config file: /etc/wt/wt_config.xml (location = '/home/dwalter/workspace/wtapp/src/wtapp')"
[2011-May-05 17:14:17.445092] 28629 - [notice] "Started server: http://0.0.0.0:8080"
[2011-May-05 17:14:18.307272] 28629 [/ eTpaQjWmfLb3IjJk] [notice] "Session created (#sessions = 1)"
Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.205 Safari/534.16
127.0.0.1 - - [2011-May-05 17:14:18.309664] "GET /ANY_URL HTTP/1.1" 200 2341
127.0.0.1 - - [2011-May-05 17:14:18.316531] "GET /resources//themes/default/wt.css HTTP/1.1" 304 0
127.0.0.1 - - [2011-May-05 17:14:18.349994] "GET /NY_URL?wtd=eTpaQjWmfLb3IjJk&request=script&rand=2763859186 HTTP/1.1" 200 29912
127.0.0.1 - - [2011-May-05 17:14:18.445383] "POST /?wtd=eTpaQjWmfLb3IjJk HTTP/1.1" 200 41

BUG is here:

127.0.0.1 - - [2011-May-05 17:14:18.349994] "GET /NY_URL?wtd=eTpaQjWmfLb3IjJk&request=script&rand=2763859186 HTTP/1.1" 200 29912

is this a bug with wt, or with my configuration or the application?

thank you for your help.

Redgards,

Daniel


Replies (1)

RE: porgressive bootstrap bug - Added by Daniel Walter about 13 years ago

ok, as far as i can see, this bug has nothing to do with the bootstrap method.

this only happens if javascript is turned on and the baseURL property is set.

<property name="baseURL">http://localhost:8080/</property>
    (1-1/1)