开发者

Place GWT application on Jetty

Can someone help me to place my GWT application on Jetty. I am not using maven. I have libraries in my build path.

First I am taking the war folder already exploded and copy it in jetty/webapps, then in folder context.

  1. I have placed a folde named BiddingSystem in folder web apps, it is an already exploded folder and not a .war file

  2. In folder jetty/context, there is a file test.xml I am renaming the file to BiddingSystem.xml

and also editing content of BiddingSystem.xml, finally the content of BiddingSystem.xml is

<?xml version="1.0"  encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<configure class="org.mortbay.jetty.webapp.WebAppContext">
  <set name="contextPath">/BiddingSystem</set>
  <set name="war"><systemproperty name="jetty.home" default="."/&开发者_StackOverflowgt;/webapps/BiddingSystem</set>
</configure>

I am getting this error:

Place GWT application on Jetty


to deploy GWT app on Jetty, you often do not need to configure anything.

Copy your 'war' folder (which is created in your eclipse project by GWT) to JETTY_HOME\webapps change the name 'war' to anything you like for examples "StockWatcher" so you will have JETTY_HOME\webapps\StockWatcher. Now start jetty server and try http://localhost:8080/StockWatcher on your Chrome :)


When GWT is compiled it creates just javascript and html (plus resources like css/jpg/etc..). GWT jars and your Java classes are only used during build process and NOT needed during deployment.

So, you just need to copy contents of you /war directory to your Jetty deployment directory.

There is a .html file which is called host page. It links to all other javascript and css pages needed. This is the entry point to your app. Just open this page in your browser.

It seems that you are new to GWT so there are a few basic things you need to know:

  1. GWT is a client-side technology. You write Java code which is compiled to javascript that then runs inside browser. In this sense GWT is more related to javascript libraries (jQuery,..) than classic page-by-page web frameworks (jsf, Ror, php).

  2. GWT app runs inside a single HTML page (called a host page). This page ever reloads. Look at Gmail to see how this works (though Gmail itself is not written in GWT) .

  3. GWT is NOT a server side technology. You can use any technology on the server side (php, RoR, anything) that supports REST.

  4. GWT can talk to server via AJAX. The data exchange format can be JSON or XML. Backend can be any technology that can produce REST-style JSON or XML content. If you have Java backend you can use GWT-RPC which adds some more capabilities over AJAX/JSON.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜