Integrated Application Platform › Forums › General › HTTPServer and static HTML pages
- This topic has 8 replies, 2 voices, and was last updated 10 years, 9 months ago by
emilevanpassel.
-
AuthorPosts
-
August 30, 2012 at 9:05 pm #737
emilevanpassel
ParticipantI am using HTTPServer to do Ajax style calls, which works fine. The issue I have now, is that the basic page I use it just a small HTML file I start directly from it’s location, but I was wondering how I can start the file via HTTPServer. Can HTTPServer also serve static HTML files, that reside in some directory on a server?
August 30, 2012 at 9:24 pm #935amckinlay
KeymasterThere’s nothing built-in to serve static files, but it would be relatively easy to add something.
Another option is to put the static pages in a “book” in the database – that keeps the system more self contained. But it means using Suneido’s book editor whereas you might want to use an external HTML editor.
Currently the “routing” with HtmlMap is quite basic. You would need to do something like add a “file” entry and map it to a function that reads external files, but then the url would have to be /file/…
I think the stdlib HtmlMap had a “Res” entry that mapped to GetBookRes
The other option would be to modify HttpServer e.g. so if the path wasn’t found it would look in some directory.
Hope that helps.
August 31, 2012 at 9:06 am #936emilevanpassel
ParticipantI checked HttpMap and noticed the GetCodeRes function. It searches the RES for files. I used that one, and it works nicely. Now I can fetch the HTML, CSS and JS files without having to use local copies of the files. I tested it using FireFox and it works fine. IE is easy, getting it to work under FireFox is something else 😀
I have one more question about using a browser for an application: actually I was using the BrowserControl, because I wanted to use some functions from within Suneido. But it seems to me that the browser uses IE6 (as ActiveX component), and I had some difficult times with CSS and IE6. So I tried FireFox and that works fine. The question now is: can I also use FireFox from within BrowserControl? I understand it should be possible to use ATLAX with other ActiveX components, but I’m not sure this works well for FireFox.
August 31, 2012 at 2:41 pm #937amckinlay
KeymasterI don’t know if it is possible to use FIrefox (or another browser) as an ActiveX control. It might be but I’ve never tried.
The ability to pass a URL to AtlAxWin is something built-in to Windows. I would hope it would use the latest version of IE, but I don’t know how to control that. You might be able to pass a ProgID or CLSID and specify a particular browser version.
One advantage of using a separate browser (instead of BrowserControl) is that users don’t need to run Suneido, they just need a browser. But that is only relevant in a multi-user situation.
I looked at using Chromium Embedded with Suneido but didn’t finish anything. (See my blog post.)
September 1, 2012 at 5:47 pm #938emilevanpassel
ParticipantAt the moment I am using FireFox as a client, and it works OK. Also I enjoy the develoment tools that come with FireFox. Downside is the use of JavaScript, I would prefer Suneido as language in that case. Another downside is that my application uses a FTP Client, and the code in Suneido was very usefull. But doing a up-/download from JavaScript is something I am still puzzling on. There are tools that can have a GUI based client inside FireFox, but I need something that can be code controlled. Still puzzling… 😕
September 1, 2012 at 5:57 pm #939amckinlay
KeymasterYes, working with web technology has its good points and its bad points.
November 10, 2012 at 3:54 pm #940emilevanpassel
ParticipantI have been experimenting now for some time with HTML/JavaScript and Ajax style communications with the Suneido server. It has been interesting, but mostly frustrating. Working in multiple languages, multiple IDE’s, dealing with one-page web application issues, very complex. From a user perspective I think the one-page web application is very limited. Dealing with a small space leads to a lot of compromises, leading away from the traditional application behavior that users are used to. Not a good direction I think.
Next thing to explore? I think I will give wxWidgets a shot. I used it with Python before (wxPython), and it seems a good platform independent GUI environment.
November 28, 2012 at 7:31 pm #941amckinlay
KeymasterBjoern did some work on wxWidgets although I haven’t heard anything lately. I can forward you our email exchanges if that would be of interest.
I’ve also been following the Eclipse RAP project. They are mostly targeting the browser for the client, but their approach avoids dealing with HTML / CSS / JavaScript
Sorry for the slow response, for some reason I did not get an email notification.
December 14, 2012 at 7:44 pm #942emilevanpassel
ParticipantSorry for the bit late reaction. I have checked out RAP in the meantime, but I think it is too heavy. I worked with wxPython before, that seemed ok to me. So for a platform independent client solution, wxWidget bindings are still a good option. You can send me the information if you want. Or do you have any other suggestions for a client?
-
AuthorPosts
- You must be logged in to reply to this topic.