Hey Sohail, 2008/9/21 Sohail Somani <[EMAIL PROTECTED]>: > I'm investigating Wt for a project and it appeals to me quite a bit. The > only thing I am concerned about is how one is supposed to support links > to (possibly computed) resources, for example reports. > > Is there a way to set things up so I can send a link such as: > > http://foo.com/app.wt/reports/99 > > The first thing I thought of is that this can be done when creating the > application but if the user already has a session, then this function > will not get called. > > Any other options?
That is true, you could do it in a new session, but, indeed this is not what you will want. The WResource class serves this purpose. If you have precomputed the contents, you can use a WFileResource or WMemoryResource. If you want to compute the report on the fly, then you should reimplement WResource (resourceMimeType() and streamResourceData()). In either case, you can use suggestFileName() to "report-99.doc", which will be used by the browser together with the mime type to detect the document type, or when the user saves the file as a default file name. 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
