Creating GWT application with GWT-Ext controls, running on JBoss using NetBeans. Step By Step
Decided to share with the General public how to create a full-fledged GWT application using NetBeans and how to deploy it on the JBoss application server. Unfortunately I have not found a complete description of this process(there are articles GWT separately, separately, about GWT-EXT and separately about JBoss), so I decided to gather everything in one pile. I hope someone this guide useful and will serve as a starting point. So let's start.
Caution! Many great screenshots
the
— the Sun JDK v1.6
— JBoss Application Server v4.2.3 GA
— NetBeans v6.5.1
— Google Web Toolkit 1.6.4
— GWT-Ext v2.0.5
— ExtJS v2.0.2 or extjs.com/products/extjs/download.php
the
— In my manual I will use the directory
— Remember that when setting environment variables in Windows XP better to restart
the
How to instalit Java I to tell you probably not going. Everything has already been chewed and chewed many times. I can only say that full health you need to in environment variables was spelled out variable JAVA_HOME.
the
The archives must be unpacked in the following way. Do not forget to specify environment variables.
the
the
After unpacking, go to JBoss/bin and launch the run.bat. If all goes well, we should see the following:
the
After installing NetBeans you need to go to Tools -> Plugins. There in the tab to select the plugin GWT4NB. After installation of the plugin should look like the following:
the
the
Click right button on project and select Deploy. Because we have a JBoss is already running, NetBeans will compile the project and put on the server. Should look like this:
The project is now available at the following url: http://localhost:8080/SampleGwtApplication. There will be a button that says.
the
For this we need to create the service. Press the right button on the project.
After NetBeans will generate the necessary classes go to MainModuleEntryPoint.java and there in the onModuleLoad function, write the following:
Republish the project. After compiling the project page (http://localhost:8080/SampleGwtApplication) will appear a text box and a button. The button will send a full Ajax request to the server. Details about the structure of services and how they work with the client to read the Internets.
the
...create a new library in NetBeans
Specify the library itself, which lies C:\Java\GXT\gwtext.jar
...and documentation
Now in the file MainModule.gwt.xml add one line:
Now in the code MainEntryPoint.java we can use GWT-Ext controls. However, this is not enough to make it work. Still need to put in the project client scripts in ExtJS. You need to create in the web folder of the scripts folder, css, and images. Like here:
...from the archives ext-2.0.2.zip in the scripts folder, need to put adapter and ext-all.js
... in the css folder you need to put the contents of ext-2.0.2.zip/resources/css
... in the images folder you need to put the contents of ext-2.0.2.zip/resources/images
...now plug these scripts in the page. Write in file welcomeGWT.html here are the things...
There is the little. In the code MainModuleEntryPoint.java I write to create a GWT-Ext panel and buttons for her. Similarly, you can use other controls of pacaja com.gwtext.client.widgets
Republish the project and see the result
That's all. Thank you for your attention.
PS Sorry for the awkwardness of style and great pictures. Time 23.41, and I still sit at work. For you to try.
Article based on information from habrahabr.ru
Caution! Many great screenshots
the
We need:
— the Sun JDK v1.6
— JBoss Application Server v4.2.3 GA
— NetBeans v6.5.1
— Google Web Toolkit 1.6.4
— GWT-Ext v2.0.5
— ExtJS v2.0.2 or extjs.com/products/extjs/download.php
the
Couple things
— In my manual I will use the directory
C:/Java.
In it, I'm going to put all the necessary things. Suggest you do the same.— Remember that when setting environment variables in Windows XP better to restart
the
Step 1. Install Java
How to instalit Java I to tell you probably not going. Everything has already been chewed and chewed many times. I can only say that full health you need to in environment variables was spelled out variable JAVA_HOME.
the
Step 2. Unpacking all the archives and environment variables
The archives must be unpacked in the following way. Do not forget to specify environment variables.
Sun JDK v1.6 | C:\Java\Jdk | JAVA_HOME |
JBoss Application Server v4.2.3 GA | C:\Java\JBoss | JBOSS_HOME |
Google Web Toolkit 1.6.4 | C:\Java\GWT | GWT_HOME |
GWT-Ext v2.0.5 | C:\Java\GXT | GXT_HOME |
the
Step 3. Start JBoss
After unpacking, go to JBoss/bin and launch the run.bat. If all goes well, we should see the following:
the
Step 4. NetBeans and the GWT4NB plugin installation
After installing NetBeans you need to go to Tools -> Plugins. There in the tab to select the plugin GWT4NB. After installation of the plugin should look like the following:
the
Step 5. Create a web project
the
Step 6. Test publishing a project
Click right button on project and select Deploy. Because we have a JBoss is already running, NetBeans will compile the project and put on the server. Should look like this:
The project is now available at the following url: http://localhost:8080/SampleGwtApplication. There will be a button that says.
the
Step 7. Teach the client part to pull server-side code. AJAX in action
For this we need to create the service. Press the right button on the project.
After NetBeans will generate the necessary classes go to MainModuleEntryPoint.java and there in the onModuleLoad function, write the following:
Republish the project. After compiling the project page (http://localhost:8080/SampleGwtApplication) will appear a text box and a button. The button will send a full Ajax request to the server. Details about the structure of services and how they work with the client to read the Internets.
the
Step 8. Fasten GWT-Ext
...create a new library in NetBeans
Specify the library itself, which lies C:\Java\GXT\gwtext.jar
...and documentation
Now in the file MainModule.gwt.xml add one line:
Now in the code MainEntryPoint.java we can use GWT-Ext controls. However, this is not enough to make it work. Still need to put in the project client scripts in ExtJS. You need to create in the web folder of the scripts folder, css, and images. Like here:
...from the archives ext-2.0.2.zip in the scripts folder, need to put adapter and ext-all.js
... in the css folder you need to put the contents of ext-2.0.2.zip/resources/css
... in the images folder you need to put the contents of ext-2.0.2.zip/resources/images
...now plug these scripts in the page. Write in file welcomeGWT.html here are the things...
There is the little. In the code MainModuleEntryPoint.java I write to create a GWT-Ext panel and buttons for her. Similarly, you can use other controls of pacaja com.gwtext.client.widgets
Republish the project and see the result
That's all. Thank you for your attention.
PS Sorry for the awkwardness of style and great pictures. Time 23.41, and I still sit at work. For you to try.