JaroslavTulach: /* Jersey Media HTML JSON */ - 2015-12-10 09:53:13

Jersey Media HTML JSON

←Older revision Revision as of 09:53, 10 December 2015
Line 9: Line 9:
<groupId>org.glassfish.jersey.media</groupId>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>html-json</artifactId>
<artifactId>html-json</artifactId>
-
<version>2.1</version> <!-- once released, version 2.6 will have new, updated bits -->
+
<version>2.6</version>
<scope>runtime</scope>
<scope>runtime</scope>
</dependency>
</dependency>

JaroslavTulach: /* Jersey Media HTML JSON */ - 2014-01-19 20:02:58

Jersey Media HTML JSON

←Older revision Revision as of 20:02, 19 January 2014
Line 9: Line 9:
<groupId>org.glassfish.jersey.media</groupId>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>html-json</artifactId>
<artifactId>html-json</artifactId>
-
<version>2.1</version>
+
<version>2.1</version> <!-- once released, version 2.6 will have new, updated bits -->
<scope>runtime</scope>
<scope>runtime</scope>
</dependency>
</dependency>

JaroslavTulach: /* Jersey Media HTML JSON */ - 2013-07-25 19:00:13

Jersey Media HTML JSON

←Older revision Revision as of 19:00, 25 July 2013
Line 9: Line 9:
<groupId>org.glassfish.jersey.media</groupId>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>html-json</artifactId>
<artifactId>html-json</artifactId>
-
<version>2.1-SNAPSHOT</version>
+
<version>2.1</version>
<scope>runtime</scope>
<scope>runtime</scope>
</dependency>
</dependency>

JaroslavTulach at 09:53, 7 June 2013 - 2013-06-07 09:53:39

←Older revision Revision as of 09:53, 7 June 2013
Line 25: Line 25:
Your [[Java]] code can now run on a server as well as get [[Bck2Brwsr]]!
Your [[Java]] code can now run on a server as well as get [[Bck2Brwsr]]!
 +
 +
 +
[[Category:OpenSourceContribution]]

JaroslavTulach: /* Jersey Media HTML JSON */ - 2013-05-20 12:39:46

Jersey Media HTML JSON

←Older revision Revision as of 12:39, 20 May 2013
Line 18: Line 18:
<source lang="bash">
<source lang="bash">
$ hg clone https://hg.java.net/hg/html~demo
$ hg clone https://hg.java.net/hg/html~demo
-
$ cd html~demo/cd chat/server/
+
$ cd html~demo/chat/server/
$ mvn process-classes exec:java
$ mvn process-classes exec:java
</source>
</source>

JaroslavTulach: /* Jersey Media HTML JSON */ - 2013-05-20 12:39:25

Jersey Media HTML JSON

←Older revision Revision as of 12:39, 20 May 2013
Line 24: Line 24:
The ([[Jersey]] and [[Grizzly]] based) server starts on port 8080. Just open your [[Chrome]] browser (there are some problems with [[Firefox]] and my use of '''XHR''''s ''POST'' method) and point it to ''http://localhost:8080''. In a few seconds, you should see a chat application running via the [[Bck2Brwsr]] [[VM]]. The message is represented by a [https://hg.java.net/hg/html~demo/file/65cadba2cf02/chat/model/src/main/java/org/apidesign/html/chatserver/model/MessageImpl.java Message] class and this class is the same on the server as well as in the browser. It is transmitted in a [[JSON]] format, but it can also contain additional (for example validation or presentation) logic.
The ([[Jersey]] and [[Grizzly]] based) server starts on port 8080. Just open your [[Chrome]] browser (there are some problems with [[Firefox]] and my use of '''XHR''''s ''POST'' method) and point it to ''http://localhost:8080''. In a few seconds, you should see a chat application running via the [[Bck2Brwsr]] [[VM]]. The message is represented by a [https://hg.java.net/hg/html~demo/file/65cadba2cf02/chat/model/src/main/java/org/apidesign/html/chatserver/model/MessageImpl.java Message] class and this class is the same on the server as well as in the browser. It is transmitted in a [[JSON]] format, but it can also contain additional (for example validation or presentation) logic.
-
Your code can now run on a server as well as get [[Bck2Brwsr]]!
+
Your [[Java]] code can now run on a server as well as get [[Bck2Brwsr]]!

JaroslavTulach: /* Jersey Media HTML JSON */ - 2013-05-20 12:39:12

Jersey Media HTML JSON

←Older revision Revision as of 12:39, 20 May 2013
Line 22: Line 22:
</source>
</source>
-
The ([[Jersey]] and [[Grizzly]] based) server starts on port 8080. Just open your [[Chrome]] browser (there are some problems with [[Firefox]] and my use of '''XHR''''s ''POST'' method) and point it to ''http://localhost:8080''. In a few seconds, you should see a chat application running via the [[Bck2Brwsr]] [[VM]]. The message is represented by a [https://hg.java.net/hg/html~demo/file/65cadba2cf02/chat/model/src/main/java/org/apidesign/html/chatserver/model/MessageImpl.java Message] class and this class is the same on the server as well as in the browser. It is transmitted in a [[JSON]] format, but it can also contain additional (for example validation) logic.
+
The ([[Jersey]] and [[Grizzly]] based) server starts on port 8080. Just open your [[Chrome]] browser (there are some problems with [[Firefox]] and my use of '''XHR''''s ''POST'' method) and point it to ''http://localhost:8080''. In a few seconds, you should see a chat application running via the [[Bck2Brwsr]] [[VM]]. The message is represented by a [https://hg.java.net/hg/html~demo/file/65cadba2cf02/chat/model/src/main/java/org/apidesign/html/chatserver/model/MessageImpl.java Message] class and this class is the same on the server as well as in the browser. It is transmitted in a [[JSON]] format, but it can also contain additional (for example validation or presentation) logic.
Your code can now run on a server as well as get [[Bck2Brwsr]]!
Your code can now run on a server as well as get [[Bck2Brwsr]]!

JaroslavTulach: /* Jersey Media HTML JSON */ - 2013-05-20 12:38:34

Jersey Media HTML JSON

←Older revision Revision as of 12:38, 20 May 2013
Line 22: Line 22:
</source>
</source>
-
The ([[Jersey]] and [[Grizzly]] based) server starts on port 8080. Just open your [[Chrome]] browser and point it to ''http://localhost:8080''. In a few seconds, you should see a chat application running via the [[Bck2Brwsr]] [[VM]]. The message is represented by a [https://hg.java.net/hg/html~demo/file/65cadba2cf02/chat/model/src/main/java/org/apidesign/html/chatserver/model/MessageImpl.java Message] class and this class is the same on the server as well as in the browser. It is transmitted in a [[JSON]] format, but it can also contain additional (for example validation) logic.
+
The ([[Jersey]] and [[Grizzly]] based) server starts on port 8080. Just open your [[Chrome]] browser (there are some problems with [[Firefox]] and my use of '''XHR''''s ''POST'' method) and point it to ''http://localhost:8080''. In a few seconds, you should see a chat application running via the [[Bck2Brwsr]] [[VM]]. The message is represented by a [https://hg.java.net/hg/html~demo/file/65cadba2cf02/chat/model/src/main/java/org/apidesign/html/chatserver/model/MessageImpl.java Message] class and this class is the same on the server as well as in the browser. It is transmitted in a [[JSON]] format, but it can also contain additional (for example validation) logic.
Your code can now run on a server as well as get [[Bck2Brwsr]]!
Your code can now run on a server as well as get [[Bck2Brwsr]]!

JaroslavTulach: /* Jersey Media HTML JSON */ - 2013-05-20 12:37:02

Jersey Media HTML JSON

←Older revision Revision as of 12:37, 20 May 2013
Line 3: Line 3:
== [[Jersey]] Media [[JSON4Brwsr|HTML JSON]] ==
== [[Jersey]] Media [[JSON4Brwsr|HTML JSON]] ==
-
A new module has been donated to [[Jersey]] version 2.1. Just include it on your own application path as
+
A new module has been donated to [[Jersey]] version 2.1. Just include it on your server own application path as
<source lang="xml">
<source lang="xml">

JaroslavTulach at 12:27, 20 May 2013 - 2013-05-20 12:27:26

←Older revision Revision as of 12:27, 20 May 2013
Line 1: Line 1:
-
The [http://bck2brwsr.apidesign.org/javadoc/net.java.html.json net.java.html.json] has been primarily designed to run in a [[JSON4Brwsr|browser]]. However almost every application in a browser tries to communicate with some server. The application logic is then split into two distinct systems - yet certain parts of the code need to run on both sides (think about validation - prevalidate on client, re-validate on server, before database is modified). Can we use the same code in browser as well as on server?
+
The [http://bck2brwsr.apidesign.org/javadoc/net.java.html.json/ net.java.html.json] has been primarily designed to run in a [[JSON4Brwsr|browser]]. However almost every application in a browser tries to communicate with some server. The application logic is then split into two distinct systems - yet certain parts of the code need to run on both sides (think about validation - prevalidate on client, re-validate on server, before database is modified). Can we use the same code in browser as well as on server?
== [[Jersey]] Media [[JSON4Brwsr|HTML JSON]] ==
== [[Jersey]] Media [[JSON4Brwsr|HTML JSON]] ==