douji1058
2010-09-08 20:35
浏览 97
已采纳

将Web应用程序部署为独立可执行文件

I have a web application that I developed with the Google Web Toolkit (GWT), it is a utility application that helps make calculations when planning specific server deployments. I want to be able to offer this application as a download on my website for people that want to use the application but don't always have internet access.

I was previously able to achieve this by packaging all of files that GWT compiles (html and js) into a Nullsoft Installer Script (NSIS) that would just extract them to a temp directory and then tell Windows to open the main html file with whatever browser was the default.

Recently this has given me problems, it seems that some browsers don't mind this at all while others have their own quirks and problems rendering the application useless.

This application only makes 1 server call to fetch a xml file that contains the configuration data for how the calculations should be made. There is a small php component that allows the user to save and load previous configurations but it is not a problem to disable this feature for offline standalone executable deployment.

So my question is this, is there an existing framework that would allow my to package my application along with an embedded webserver so that when the application is ran it actually is running on a local web server? Or is there an existing framework to embed a web application into a redistributable browser, so that when the user tries to open the application it automatically opens the packaged browser, that way I could be able to fine tune the offline experience to always work as desired with the packaged browser.

Thanks for any replies

图片转代码服务由CSDN问答提供 功能建议

我有一个我用Google Web Toolkit(GWT)开发的Web应用程序,它是一个实用的应用程序,可以帮助我 在规划特定服务器部署时进行计算。 我希望能够在我的网站上为需要使用该应用程序的人提供此应用程序,但并不总是可以访问互联网。

我之前能够实现这一目标 通过将GWT编译的所有文件(html和js)打包成Nullsoft安装程序脚本(NSIS),将其提取到临时目录,然后告诉Windows使用默认的任何浏览器打开主html文件。

最近这给了我一些问题,似乎有些浏览器根本不介意这一点,而其他浏览器有自己的怪癖和问题,使应用程序无用。

此应用程序仅进行1次服务器调用以获取包含有关如何进行计算的配置数据的xml文件。 有一个小的PHP组件允许用户保存和加载以前的配置,但是为离线独立可执行部署禁用此功能不是问题。

所以我的问题是这个,是 有一个现有的框架,允许我将我的应用程序与嵌入式Web服务器打包在一起,这样当应用程序运行时,它实际上是在本地Web服务器上运行的吗? 或者是否存在将Web应用程序嵌入到可再发行的浏览器中的现有框架,以便当用户尝试打开应用程序时它会自动打开打包的浏览器,这样我就可以微调离线体验以始终按需运行 使用打包的浏览器。

感谢您的回复

  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

4条回答 默认 最新

  • dtpwra8456 2010-09-08 20:48
    已采纳

    If IE is not one of the trouble browsers, you could create a small .NET app that embeds a web browser control and opens it to the desired page.

    You might even be able to achieve this using Gecko:

    http://code.google.com/p/geckofx/

    已采纳该答案
    打赏 评论
  • dpikoto468637 2010-09-08 20:41

    I upvoted this as it's something I'd be very interested in finding a solution for. This was literally just on my mind a day ago. From what I figured, deploying a web app that requires some type of stand-alone web server to process the files just isn't possible. You said it's mainly in JavaScript and you wouldn't mind killing the PHP functionality - in this case Adobe AIR might be a simple solution (syntax is very similar to JS, should be a quick conversion if you're familiar with it). Basically though - from my understanding - you'll have to port it.

    打赏 评论
  • dongyata3336 2010-09-08 20:54

    I think the simplest way is to use Google Gears or HTML5 storage capabilities and add an offline mode to this application. Therefore, you just need to open the application once in the browser and enable the offline access. Then, it just works simply using the offline capabilities.

    http://www.w3.org/TR/offline-webapps/ http://www.devcomments.com/HTML5-Offline-GWT-APP-at246553.htm

    打赏 评论
  • dongyue9864 2010-09-09 00:09

    I'm assuming that because you're using gwt, that your logic is written in Java?

    Surely you can package all the components you need into a standard Java runtime of some sort?

    打赏 评论

相关推荐 更多相似问题