简体   繁体   English

在Tomcat中部署GWT RPC应用程序

[英]Deploying GWT RPC app in Tomcat

As per the Google tutorial, I have developed the basic StockWatcher application, that makes an RPC call to the server, which sends some data, which is displayed on the client. 根据Google教程,我开发了基本的StockWatcher应用程序,它对服务器进行RPC调用,该服务器发送一些数据,这些数据显示在客户端上。

I now want to deploy it in Tomcat, such that if call something like localhost/StockWatcher , I should get the same experience as when running the app from GWT in development mode. 我现在想在Tomcat中部署它,这样如果调用类似localhost/StockWatcher东西,我应该获得与在开发模式下从GWT运行应用程序时相同的体验。

How do I do this? 我该怎么做呢? There is a similar topic here , but I couldn't much understand it. 有类似的话题在这里 ,但我没有太多的了解它。 If I only copy the compiled war folder, what happens to the GreetingServiceImpl class which handles the RPC? 如果我只复制编译的war文件夹,那么处理RPC的GreetingServiceImpl类会发生什么? And how do I do the mapping such that localhost/StockWatcher maps to localhost:8080 (something like Mod_Rewrite )? 我如何进行映射,使localhost/StockWatcher映射到localhost:8080 (类似于Mod_Rewrite )?

Steps to deploy war on TOMCAT 在TOMCAT上部署战争的步骤

    1)Compile you gwt web application
    2)Copy  the war file 
    3)Add all libraries(jar files) in lib folder of war file 
    4)Rename your war as "myapp"
    5)create a .war file with that "myapp" folder
    6)start tomcat with catalina.bat run.

For step5 (generating .war file ): Preparing .war file from command line 对于step5(生成.war文件): 从命令行准备.war文件

Normally if you deploy well your war directory and you are able to start tomcat you have done everything. 通常,如果您部署好war目录并且能够启动tomcat,那么您已经完成了所有操作。 If you access your page using this url : localhost:8080/StockWatcher gwt will know that it must use that url as a baseURL for all gwt/rpc requests. 如果您使用此URL访问您的页面:localhost:8080 / StockWatcher gwt将知道它必须将该url用作所有gwt / rpc请求的baseURL。

To generate the war using Eclipse : right click on the project -> export -> war. 使用Eclipse生成战争:右键单击项目 - > export - > war。 You will have the war exported with all the dependencies inside. 您将使用所有依赖项导出war。 just unzip it in the ROOT directory 只需将其解压缩到ROOT目录中即可

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM