Skip to content

Commit dd14031

Browse files
committed
Modify with "Part 3 - GWT RPC Services"
1 parent 820d3b2 commit dd14031

17 files changed

+213
-18
lines changed

.classpath

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333
<attribute name="owner.project.facets" value="jst.web"/>
3434
</attributes>
3535
</classpathentry>
36-
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
36+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/java-8-openjdk-amd64">
3737
<attributes>
38-
<attribute name="maven.pomderived" value="true"/>
38+
<attribute name="owner.project.facets" value="java"/>
3939
</attributes>
4040
</classpathentry>
4141
<classpathentry kind="output" path="target/classes"/>

.project

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,16 @@
3030
<arguments>
3131
</arguments>
3232
</buildCommand>
33+
<buildCommand>
34+
<name>com.google.gdt.eclipse.core.webAppProjectValidator</name>
35+
<arguments>
36+
</arguments>
37+
</buildCommand>
38+
<buildCommand>
39+
<name>com.google.gwt.eclipse.core.gwtProjectValidator</name>
40+
<arguments>
41+
</arguments>
42+
</buildCommand>
3343
</buildSpec>
3444
<natures>
3545
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
@@ -38,5 +48,6 @@
3848
<nature>org.eclipse.m2e.core.maven2Nature</nature>
3949
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
4050
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
51+
<nature>com.google.gwt.eclipse.core.gwtNature</nature>
4152
</natures>
4253
</projectDescription>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
eclipse.preferences.version=1
2+
warSrcDir=src/main/webapp
3+
warSrcDirIsOutput=false
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
eclipse.preferences.version=1
2+
entryPointModules=

.settings/org.eclipse.jdt.core.prefs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
eclipse.preferences.version=1
22
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3-
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
4-
org.eclipse.jdt.core.compiler.compliance=1.5
3+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
4+
org.eclipse.jdt.core.compiler.compliance=1.7
55
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
66
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
77
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
8-
org.eclipse.jdt.core.compiler.source=1.5
8+
org.eclipse.jdt.core.compiler.source=1.7

.settings/org.eclipse.wst.common.project.facet.core.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<faceted-project>
33
<runtime name="Apache Tomcat v6.0"/>
44
<fixed facet="wst.jsdt.web"/>
5-
<installed facet="java" version="1.5"/>
65
<installed facet="jst.web" version="2.5"/>
76
<installed facet="wst.jsdt.web" version="1.0"/>
7+
<installed facet="java" version="1.7"/>
88
</faceted-project>

ReadMe.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
This project is a step-by-step Spring-GWT tutorial.
2-
It is inspired from the article written by Alex Tretyakov on 2011-10-24
3-
[Spring and GWT tutorial. Part 2 - Adding GWT ](http://alextretyakov.blogspot.fr/2011/10/recently-ive-started-working-in-gwt.html).
2+
It is inspired from the article written by Alex Tretyakov on 2011-11-25
3+
[Spring and GWT tutorial. Part 3 - GWT RPC Services](http://alextretyakov.blogspot.fr/2011/10/developing-simple-web-application-using.html).
44

55
The project was created as a "Maven Project" in Eclipse.
66
Then files from hellogwt were added.
@@ -22,6 +22,14 @@ The source code is licensed under [Apache License 2.0](http://www.apache.org/lic
2222
`~/bin/apache-tomcat-6.0.43/bin/startup.sh`.
2323
7. Go to http://localhost:8080/hellogwt/.
2424

25+
If you have configured `$HOME/.m2/settings.xml` with a server called Tomcat6:
26+
27+
1. If Tomcat is not running, start it.
28+
`~/bin/apache-tomcat-6.0.43/bin/startup.sh`
29+
2. Build and deploy the project by executing `mvn tomcat6:deploy` command.
30+
You can use `mvn tomcat6:redeploy` if the war was deployed.
31+
3. Go to http://localhost:8080/hellogwt/.
32+
2533
== In Eclipse ==
2634

2735
You need to install those plug-ins:

pom.xml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Now, we add GWT (gwt-servlet and gwt-user artifacts) and Log4J to our project.
1818
<spring.version>4.0.3.RELEASE</spring.version>
1919
<spring4gwt.version>0.0.1</spring4gwt.version>
2020
<spring4gwt.md5>640e1e3fc08f2e175cb52e7f922d47ad</spring4gwt.md5>
21+
<log4j.version>1.2.16</log4j.version>
2122
<!-- Convenience property to set the GWT version -->
2223
<gwt.version>2.7.0</gwt.version>
2324
<!-- Note: GWT needs at least java 1.6 -->
@@ -45,6 +46,11 @@ Now, we add GWT (gwt-servlet and gwt-user artifacts) and Log4J to our project.
4546
<version>${gwt.version}</version>
4647
<type>jar</type>
4748
</dependency>
49+
<dependency>
50+
<groupId>log4j</groupId>
51+
<artifactId>log4j</artifactId>
52+
<version>${log4j.version}</version>
53+
</dependency>
4854
</dependencies>
4955

5056
<build>
@@ -66,11 +72,15 @@ Now, we add GWT (gwt-servlet and gwt-user artifacts) and Log4J to our project.
6672
</executions>
6773
</plugin>
6874
<!-- $HOME/.m2/settings.xml
69-
<server>
70-
<id>Tomcat6</id>
71-
<username>tomcat</username>
72-
<password>tomcat</password>
73-
</server>
75+
<settings>
76+
<servers>
77+
<server>
78+
<id>Tomcat6</id>
79+
<username>tomcat</username>
80+
<password>tomcat</password>
81+
</server>
82+
</servers>
83+
</settings>
7484
-->
7585
<plugin>
7686
<!-- http://tomcat.apache.org/maven-plugin-2.2/context-goals.html -->

src/main/java/com/hellogwt/HelloGWT.gwt.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,18 @@ XML module file for the com.hellogwt package.
88
"http://gwtproject.org/doctype/2.7.0/gwt-module.dtd">
99

1010
<module rename-to='hellogwt'>
11+
<!-- Inherit the core Web Toolkit stuff. -->
1112
<inherits name='com.google.gwt.user.User'/>
13+
14+
<!-- Inherit the default GWT style sheet. You can change -->
15+
<!-- the theme of your GWT application by uncommenting -->
16+
<!-- any one of the following lines. -->
1217
<inherits name='com.google.gwt.user.theme.standard.Standard'/>
18+
<!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
19+
<!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->
20+
21+
<!-- Other module inherits -->
22+
23+
<!-- Specify the app entry point class. -->
1324
<entry-point class='com.hellogwt.client.HelloGWT'/>
1425
</module>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/**
2+
* According to GWT RPC rules, let's create service GreetingService annotated with @RemoteServiceRelativePath in com.hellogwt.client package.
3+
* It will contain only one method greet() that takes and returns a String.
4+
* Service GreetingService should have a pair - asynchronous service GreetingServiceAsync in the same package.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
package com.hellogwt.client;
19+
20+
import com.google.gwt.user.client.rpc.RemoteService;
21+
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
22+
23+
@RemoteServiceRelativePath("springGwtServices/greetingService")
24+
public interface GreetingService extends RemoteService {
25+
26+
String greet(String name);
27+
}

0 commit comments

Comments
 (0)