File tree 32 files changed +136
-32
lines changed
dev/rico/samples/http/client
dev/rico/samples/http/client
dev/rico/samples/http/common
server-javaee/src/main/java/dev/rico/samples/http
dev/rico/samples/http/server
client-javafx/src/main/java
dev/rico/samples/security/server
client-javafx/src/main/java
server-base/src/main/java
32 files changed +136
-32
lines changed Original file line number Diff line number Diff line change @@ -40,10 +40,10 @@ In that case the application must be reachable under `http://localhost:8080/simp
40
40
==== Java
41
41
42
42
To start the JavaFX client simply run `mvn jfx:run` from the client-javafx folder.
43
- Next to this the client can be started by the `dev.rico.samples.http.RestClient` class.
43
+ Next to this the client can be started by the `dev.rico.samples.http.client. RestClient` class.
44
44
45
45
46
46
==== JavaFx
47
47
48
48
To start the JavaFX client simply run `mvn jfx:run` from the client-javafx folder.
49
- Next to this the client can be started by the `dev.rico.samples.http.RestClient` class.
49
+ Next to this the client can be started by the `dev.rico.samples.http.client. RestClient` class.
Original file line number Diff line number Diff line change 38
38
<artifactId >javafx-maven-plugin</artifactId >
39
39
<version >8.7.0</version >
40
40
<configuration >
41
- <mainClass >dev.rico.samples.http.RestClient</mainClass >
41
+ <mainClass >dev.rico.samples.http.client. RestClient</mainClass >
42
42
</configuration >
43
43
</plugin >
44
44
</plugins >
Original file line number Diff line number Diff line change 1
- package dev .rico .samples .http ;
1
+ package dev .rico .samples .http . client ;
2
2
3
3
import dev .rico .client .Client ;
4
4
import dev .rico .core .http .HttpClient ;
5
+ import dev .rico .samples .http .common .City ;
6
+ import dev .rico .samples .http .common .CityDetails ;
5
7
6
8
public class RestClient {
7
9
Original file line number Diff line number Diff line change
1
+ module dev .rico .samples .http .client .java {
2
+
3
+ requires dev .rico .samples .http .common ;
4
+ requires dev .rico .client ;
5
+ }
Original file line number Diff line number Diff line change 43
43
<artifactId >javafx-maven-plugin</artifactId >
44
44
<version >8.7.0</version >
45
45
<configuration >
46
- <mainClass >dev.rico.samples.http.RestClient</mainClass >
46
+ <mainClass >dev.rico.samples.http.client. RestClient</mainClass >
47
47
</configuration >
48
48
</plugin >
49
49
</plugins >
Original file line number Diff line number Diff line change 1
- package dev .rico .samples .http ;
1
+ package dev .rico .samples .http . client ;
2
2
3
3
import dev .rico .client .Client ;
4
4
import dev .rico .client .javafx .FxToolkit ;
5
5
import dev .rico .core .http .HttpClient ;
6
6
import dev .rico .core .http .RequestMethod ;
7
+ import dev .rico .samples .http .common .City ;
8
+ import dev .rico .samples .http .common .CityDetails ;
7
9
import javafx .application .Application ;
8
10
import javafx .geometry .Insets ;
9
11
import javafx .scene .Scene ;
@@ -36,7 +38,7 @@ public void start(Stage primaryStage) throws Exception {
36
38
withContent (city ).
37
39
readObject (CityDetails .class ).
38
40
onDone (d -> showResult (d .getContent ())).
39
- onError (ex -> showError (city )).
41
+ onError (ex -> showError (city , ex )).
40
42
execute ();
41
43
});
42
44
@@ -55,7 +57,8 @@ public void showResult(final CityDetails details) {
55
57
alert .showAndWait ();
56
58
}
57
59
58
- public void showError (final City city ) {
60
+ public void showError (final City city , final Exception exception ) {
61
+ exception .printStackTrace ();
59
62
final Alert alert = new Alert (Alert .AlertType .ERROR );
60
63
alert .setTitle ("Error" );
61
64
alert .setContentText ("Can not get details for city " + city .getName ());
Original file line number Diff line number Diff line change
1
+ module dev .rico .samples .http .client .javafx {
2
+
3
+ exports dev .rico .samples .http .client ;
4
+
5
+ requires dev .rico .samples .http .common ;
6
+ requires dev .rico .client .javafx ;
7
+ requires javafx .controls ;
8
+ }
Original file line number Diff line number Diff line change 13
13
* See the License for the specific language governing permissions and
14
14
* limitations under the License.
15
15
*/
16
- package dev .rico .samples .http ;
16
+ package dev .rico .samples .http . common ;
17
17
18
18
import java .io .Serializable ;
19
19
Original file line number Diff line number Diff line change 13
13
* See the License for the specific language governing permissions and
14
14
* limitations under the License.
15
15
*/
16
- package dev .rico .samples .http ;
16
+ package dev .rico .samples .http . common ;
17
17
18
18
public class CityDetails extends City {
19
19
Original file line number Diff line number Diff line change
1
+ module dev .rico .samples .http .common {
2
+ exports dev .rico .samples .http .common ;
3
+ opens dev .rico .samples .http .common ;
4
+ }
Original file line number Diff line number Diff line change 15
15
*/
16
16
package dev .rico .samples .http ;
17
17
18
+ import dev .rico .samples .http .common .City ;
19
+ import dev .rico .samples .http .common .CityDetails ;
20
+
18
21
import javax .ws .rs .POST ;
19
22
import javax .ws .rs .Path ;
20
23
Original file line number Diff line number Diff line change 27
27
<dependency >
28
28
<groupId >org.springframework.boot</groupId >
29
29
<artifactId >spring-boot-starter-web</artifactId >
30
- <version >1.5.9.RELEASE</version >
30
+ <version >2.2.6.RELEASE</version >
31
+ </dependency >
32
+ <dependency >
33
+ <groupId >${groupId} </groupId >
34
+ <artifactId >servlet-fake</artifactId >
35
+ <version >${version} </version >
31
36
</dependency >
32
37
</dependencies >
33
38
36
41
<plugin >
37
42
<groupId >org.springframework.boot</groupId >
38
43
<artifactId >spring-boot-maven-plugin</artifactId >
39
- <version >1.5.9 .RELEASE</version >
44
+ <version >2.2.6 .RELEASE</version >
40
45
</plugin >
41
46
</plugins >
42
47
</build >
Original file line number Diff line number Diff line change 13
13
* See the License for the specific language governing permissions and
14
14
* limitations under the License.
15
15
*/
16
- package dev .rico .samples .http ;
16
+ package dev .rico .samples .http . server ;
17
17
18
+ import dev .rico .samples .http .common .City ;
19
+ import dev .rico .samples .http .common .CityDetails ;
18
20
import org .springframework .web .bind .annotation .RequestBody ;
19
21
import org .springframework .web .bind .annotation .RequestMapping ;
20
22
import org .springframework .web .bind .annotation .RequestMethod ;
25
27
public class CityEndpoint {
26
28
27
29
@ RequestMapping (method = RequestMethod .POST )
28
- public CityDetails getDetails (@ RequestBody final City city ) {
29
- final CityDetails cityDetails = new CityDetails (city );
30
+ public CityDetails getDetails (@ RequestBody final City input ) {
31
+ final CityDetails cityDetails = new CityDetails (input );
30
32
cityDetails .setDescription ("No description" );
31
33
cityDetails .setPopulation ((long ) (Math .random () * 1_000_000 ));
32
34
return cityDetails ;
Original file line number Diff line number Diff line change 13
13
* See the License for the specific language governing permissions and
14
14
* limitations under the License.
15
15
*/
16
- package dev .rico .samples .http ;
16
+ package dev .rico .samples .http . server ;
17
17
18
18
import dev .rico .server .spring .RicoApplication ;
19
19
import org .springframework .boot .SpringApplication ;
Original file line number Diff line number Diff line change
1
+ module dev .rico .samples .http .server .spring {
2
+
3
+ requires dev .rico .samples .http .common ;
4
+ requires dev .rico .server .spring ;
5
+ requires spring .boot ;
6
+ requires spring .web ;
7
+ requires com .fasterxml .jackson .databind ;
8
+
9
+ opens dev .rico .samples .http .server ;
10
+ }
Original file line number Diff line number Diff line change 14
14
# limitations under the License.
15
15
#
16
16
17
- server.contextPath =/simple-rest
17
+ server.servlet.context-path =/simple-rest
18
+ logging.level.dev.rico =debug
Original file line number Diff line number Diff line change 31
31
</repositories >
32
32
33
33
<modules >
34
+ <module >servlet-fake</module >
34
35
<module >todo-list</module >
35
36
<module >http-client</module >
36
37
<module >rest-security</module >
Original file line number Diff line number Diff line change
1
+ module dev .rico .samples .simple .security .client .javafx {
2
+
3
+ requires dev .rico .security .client ;
4
+ }
Original file line number Diff line number Diff line change 15
15
<modules >
16
16
<module >server-spring</module >
17
17
<module >client-javafx</module >
18
- <module >client-javascript</module >
19
- <module >client-polymer</module >
20
18
</modules >
21
19
22
20
</project >
Original file line number Diff line number Diff line change 18
18
<groupId >dev.rico</groupId >
19
19
<artifactId >rico-security-server-spring</artifactId >
20
20
<version >${rico.version} </version >
21
+ <exclusions >
22
+ <exclusion >
23
+ <groupId >com.fasterxml.jackson.core</groupId >
24
+ <artifactId >jackson-core</artifactId >
25
+ </exclusion >
26
+ <exclusion >
27
+ <groupId >com.fasterxml.jackson.core</groupId >
28
+ <artifactId >jackson-databind</artifactId >
29
+ </exclusion >
30
+ </exclusions >
21
31
</dependency >
22
32
<dependency >
23
33
<groupId >dev.rico</groupId >
27
37
<dependency >
28
38
<groupId >org.springframework.boot</groupId >
29
39
<artifactId >spring-boot-starter-web</artifactId >
30
- <version >1.5.9 .RELEASE</version >
40
+ <version >2.2.6 .RELEASE</version >
31
41
</dependency >
32
42
<dependency >
33
43
<groupId >org.slf4j</groupId >
34
44
<artifactId >slf4j-api</artifactId >
35
- <version >1.7.25</version >
45
+ <version >1.7.30</version >
46
+ </dependency >
47
+ <dependency >
48
+ <groupId >${groupId} </groupId >
49
+ <artifactId >servlet-fake</artifactId >
50
+ <version >${version} </version >
36
51
</dependency >
37
52
</dependencies >
38
53
</project >
Original file line number Diff line number Diff line change 14
14
* See the License for the specific language governing permissions and
15
15
* limitations under the License.
16
16
*/
17
- package dev .rico .samples .security ;
17
+ package dev .rico .samples .security . server ;
18
18
19
19
import org .slf4j .Logger ;
20
20
import org .slf4j .LoggerFactory ;
Original file line number Diff line number Diff line change 14
14
* See the License for the specific language governing permissions and
15
15
* limitations under the License.
16
16
*/
17
- package dev .rico .samples .security ;
17
+ package dev .rico .samples .security . server ;
18
18
19
19
import dev .rico .security .server .SecurityContext ;
20
20
import org .slf4j .Logger ;
Original file line number Diff line number Diff line change 14
14
* See the License for the specific language governing permissions and
15
15
* limitations under the License.
16
16
*/
17
- package dev .rico .samples .security ;
17
+ package dev .rico .samples .security . server ;
18
18
19
19
import dev .rico .security .server .spring .EnableSecurity ;
20
20
import dev .rico .server .spring .RicoApplication ;
Original file line number Diff line number Diff line change
1
+ module dev .rico .samples .simple .security .server .spring {
2
+
3
+ exports dev .rico .samples .security .server ;
4
+ opens dev .rico .samples .security .server ;
5
+
6
+ requires org .slf4j ;
7
+ requires spring .web ;
8
+ requires spring .beans ;
9
+ requires spring .boot ;
10
+ requires dev .rico .security .server .spring ;
11
+ requires dev .rico .server .spring ;
12
+ requires com .fasterxml .jackson .databind ;
13
+ }
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <project xmlns =" http://maven.apache.org/POM/4.0.0"
3
+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
4
+ xsi : schemaLocation =" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" >
5
+ <modelVersion >4.0.0</modelVersion >
6
+
7
+ <parent >
8
+ <groupId >dev.rico.samples</groupId >
9
+ <artifactId >rico-samples</artifactId >
10
+ <version >1.0-SNAPSHOT</version >
11
+ <relativePath >../</relativePath >
12
+ </parent >
13
+
14
+ <artifactId >servlet-fake</artifactId >
15
+ </project >
Original file line number Diff line number Diff line change
1
+ module java .servlet {
2
+ }
Original file line number Diff line number Diff line change
1
+ module todo .list .client .javafx {
2
+ exports dev .rico .samples .todo .client ;
3
+ opens dev .rico .samples .todo .client ;
4
+
5
+
6
+ requires dev .rico .samples .todolist .common ;
7
+ requires dev .rico .remoting .client .javafx ;
8
+ requires javafx .fxml ;
9
+ requires javafx .controls ;
10
+ }
Original file line number Diff line number Diff line change 1
1
module dev .rico .samples .todolist .common {
2
2
exports dev .rico .samples .todo ;
3
+ opens dev .rico .samples .todo ;
3
4
4
5
requires dev .rico .remoting .common ;
5
6
}
Original file line number Diff line number Diff line change 19
19
<module >server-javaee</module >
20
20
<module >server-spring</module >
21
21
<module >client-javafx</module >
22
- <module >client-polymer</module >
23
- <module >client-angular</module >
24
- <module >client-angularjs</module >
25
22
</modules >
26
23
27
24
</project >
Original file line number Diff line number Diff line change 9
9
requires dev .rico .core ;
10
10
requires dev .rico .remoting .server ;
11
11
requires dev .rico .remoting .common ;
12
+
13
+ opens dev .rico .samples .todo .server to dev .rico .core ;
12
14
}
Original file line number Diff line number Diff line change 8
8
<groupId >dev.rico.samples</groupId >
9
9
<artifactId >todo-list</artifactId >
10
10
<version >1.0-SNAPSHOT</version >
11
- <relativePath >../</relativePath >
12
11
</parent >
13
12
14
13
<artifactId >todo-list-server-spring</artifactId >
19
18
<artifactId >todo-list-server-base</artifactId >
20
19
<version >${version} </version >
21
20
</dependency >
21
+ <dependency >
22
+ <groupId >${groupId} </groupId >
23
+ <artifactId >servlet-fake</artifactId >
24
+ <version >${version} </version >
25
+ </dependency >
22
26
<dependency >
23
27
<groupId >dev.rico</groupId >
24
28
<artifactId >rico-remoting-server-spring</artifactId >
30
34
<version >${rico.version} </version >
31
35
<scope >test</scope >
32
36
</dependency >
33
-
34
37
<dependency >
35
38
<groupId >org.springframework.boot</groupId >
36
39
<artifactId >spring-boot-starter-web</artifactId >
37
40
<version >2.2.6.RELEASE</version >
38
41
</dependency >
39
-
40
42
</dependencies >
41
43
42
44
<build >
You can’t perform that action at this time.
0 commit comments