Koen,
>> Coming from an Apache background, let me push on this in a slightly
>> different direction and suggest Wt implement much of its existing
>> functionality in the form of request phases. In fact, I know that
>> having
>> some of the below would help me out tremendously and it would solve
>> this
>> resource acquisition/release question.
>
> I doubt the usefulness of such hooks in Wt. We would only like to
> integrate those hooks which would be required because of specific
> needs in a web application (compared to a simple desktop application),
> and then I can only imagine features for:
>
> - scalability reasons: to allow for a single point for clean-up of
> temporary resources (like database connections) which you only need
> during a request/response cycle. This is why I agree that a virtual
> WApplication::endRequest() method is useful, in fact, we have
> developed a database-like application where this would have been
> useful too. A startRequest() is hardly useful since such resources
> could easily initialize themselves when first used.
Fair enough.
>> I know Wt already does most of this, but it's tucked away such that
>> it's
>> programatically tedious to find the right place to modify a request
>> or to
>> determine whether or not a given http request is secured, already
>> has a
>> validated session, etc. Another example of how this would be hugely
>> beneficial, with a headerPostParse() method, I could map a browser
>> URL of
>> "/signup" to "/#/signup" or "/ru/login" to "/#/login" and set an
>> HTTP header
>> that sets the localization to use (btw, is there a way to do the URI
>> translation that I'm missing?).
>
> Wt will automatically map a browser URL of /signup to /#/signup ?
It doesn't, but I would like it to (right now /signup is a 404 by
default). If I bookmark or type in: /#/signup, I see just "GET / HTTP/
1.1" in the server logs. That I bookmarked the signup page is
completely lost, but, if I bookmark the non-javascript version, such
as: "/?_=/signup&wtd=Gm3iw7tZjrKwO0q7" then things work provided the
wtd session id is still valid. If the session id is invalid, then I'm
shown the contents of / and not my signup WContainerWidget.
The only way I've been able to get /signup to work is by forcing new
instances to be created via EntryPoints, which is less than ideal.
server.addEntryPoint(Wt::WServer::Application, createSignupApp,
"signup", "/favicon.ico");
Wt::WApplication *
createSignupApp(const Wt::WEnvironment& env) {
WApplication *app;
app = new SignupApp(env);
return app;
}
> You only need to handle the URL when the user logs in to your
> application (from your application constructor). There you are free to
> interpret the URL in any way you want, and immediately call
> setLocale("ru") ? Other url changes would correspond to internal path
> changes. I could see possible improvements to the internal path API
> (which could benefit from 'rewrite' logic), but these internal paths
> are already quite distinct from the request/response cycle itself, and
> perhaps this would address some of your needs ?
Improvements to the path API would be most welcome. It feels like
I've spent more time trying to get the above pathing problems figured
out than I have writing my application. :)
Regardless, I love Wt, thank you. -sc
--
Sean Chittenden
[email protected]
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest