hosting GWT project - gwt

What do i need to upload from my gwt project to web hosting?
its just html or all project files?

Any modern Java IDE gives you an option to export a web project as a war module. If your are not using an IDE, it depends:
If you just write your code under client folder, no need to upload any .class files to the server. You don't need any Java Application server as well, and a normal HTTP server (such as Apache) would suffice. An example of such a GWT application is GWT showcase which is included in GWT download package.
If you have any server-side code under server package, then you should upload .class files (under WEB-INF/classes folder in your web modile) as well as the rest of .js, .css, .jpg/gif, .html files. In this case you need a servlet container such as Tomcat to serve your server-side code.

You'll only need to upload the html files, the css files, and your java file. Also, any other file linked to within your html files need to go in the same directory.

Related

Tell Glassfish to Use Existing Zip File

I am using Glassfish 3.1.2 with Dojo 1.7 and would like to shorten the build process, it's taking quite a while for maven to copy the dojo js files each build. I could use the CDN version dojo but I would like to be able to debug when offline. Is there a way to tell Glassfish to use the pre-zipped dojo source file? Just to be clear, I don't want Glassfish to zip the files for me.
Can you place the desired resources in an independent WAR file, and deploy separately? You'll have a context path to the resources (diff URL) that is dependent on the new WAR file, but you'll be able to deploy it once.
If that's not satisfactory, you could alternatively write a small servlet (packaged in your normal app) to expose resources that you locate (*.getClass().getResourceStream()) from a jar file you've placed in glassfishv3/glassfish/domains/domain1/lib. This is trivial to do via a restful-ws, also some libraries (primefaces) facilitate exposing resources.

gwt beginner- getting error when I make an RPC call on server- same code works in gwt dev mode

I have created a simple gwt application (with gwt 2.4) that makes a single RPC call.
When I run this in GWT Dev mode, it runs fine, however when I try to run this on a server-
this is the message that I get --
POST http://app.sparkcrawler.com/com.arvindikchari.auth.App/AuthenticationService 404 (Not Found)
I have copied all files from the WAR folder in my Eclipse GWT project, to the web server's folder. The web server uses Tomcat 5.5(with Cpanel control panel). I copied these files, after successfully compiling the files ("GWT Compile Project")...
What have i done wrong here? Have i missed some files? I have copied everything from war folder, including "WEB-INF" folder and its contents, to the web server.
I think, copying the Eclipse project's WAR folder is not the appropriate way to deploy a GWT application to a server.
You first have to compile for production mode (see Understanding the GWT compiler), then with the resulting JavaScript files, create a WAR including server side classes which you can deploy to a Tomcat server. (See Deploy a GWT Application)
You can use Ant or Maven to automate this process.

deploy netbeans Java EE web project

Hi
I am new to deploying web projects. I want to deploy my Java EE Netbeans project on a different remote server. I just kept the .war file in the tomcat webapp folder and it worked fine. But I could not see the images and CSS effects in the webpage. How do I bundle my images, CSS files, scripts etc. in the .war file?
If you have a Netbeans web application project there is a folder WebPages under the project node. You can for example create a folder resources (right click on WebPages --> new folder) and put all your images, css files and scripts in it.
Then they are automatically included in the war.
(The WebPages folder in the project window is mapped to the project-name/web on file system.)
Have a look into this document: http://www.examulator.com/moodle/mod/resource/view.php?id=455 and see how it works instead of relying only on the IDE provided features, then use the IDE (like Netbeans) build the project and see the war file which IDE created for you.

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.
I have placed a folde named BiddingSystem in folder web apps, it is an already exploded folder and not a .war file
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="."/>/webapps/BiddingSystem</set>
</configure>
I am getting this error:
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:
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).
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) .
GWT is NOT a server side technology. You can use any technology on the server side (php, RoR, anything) that supports REST.
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.

GWT Deployment Confusion, Please give some guidelines

I wanted to know one thing. When deploying a GWT application on
the server, lets say an application in which there are client files
Greeting.java(entrypoint), service.java,serviceAsync.java and server
file serviceImpl.java(), only the client files will converted to
javascript. After compilation, I take the war file and place it on the
server, but where to place the server file that is serviceImpl.java???
The war file will also contain a /WEB-INF folder with the web.xml your libs and the other java classes needed for the server side.
So you only need to copy your war file in the proper webapps folder from your server.