Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

installation advises for grobmeier repo

  • Loading branch information...
commit 94a69eb66fa78075dce5896bb78dcc4f24e1928f 1 parent c36f6f6
@grobmeier authored
Showing with 77 additions and 52 deletions.
  1. +77 −52 jjson/src/site/xdoc/install.xml
View
129 jjson/src/site/xdoc/install.xml
@@ -1,78 +1,103 @@
<?xml version="1.0" encoding="UTF-8"?>
<document xmlns="http://maven.apache.org/XDOC/2.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 http://maven.apache.org/xsd/xdoc-2.0.xsd">
- <properties>
- <title>JJSON - A JSON Library for Java without dependencies</title>
- <author email="grobmeier@gmail.com">Christian Grobmeier</author>
- </properties>
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 http://maven.apache.org/xsd/xdoc-2.0.xsd">
+ <properties>
+ <title>JJSON - A JSON Library for Java without dependencies</title>
+ <author email="grobmeier@gmail.com">Christian Grobmeier</author>
+ </properties>
<!-- Optional HEAD element, which is copied as is into the XHTML <head> element -->
- <head>
- <style type="text/css">
- h2 {
- font-size: 50px;
- }
- </style>
- </head>
- <body>
- <!-- The body of the document contains a number of sections -->
- <section name="Install">
- <p>
- Just drop the jar-File(s) into your projects classpath and go for it. At the moment there is no maven repository available online,
- but this is in the works.
- </p>
- </section>
-
- <section name="Install the Struts 2 Plugin">
- Install the JsonResult? class in your struts.xml package:
-
- <source>
+ <head>
+ <style type="text/css">
+ h2 {
+ font-size: 50px;
+ }
+ </style>
+ </head>
+ <body>
+ <section name="Install with Maven">
+ <p>Currently the JJSON artifacts are only available on my own small repository. You can add the stable repository
+ when adding this to your pom.xml
+ </p>
+
+ <source>
+ &lt;repositories&gt;
+ &lt;repository&gt;
+ &lt;id>grobmeier-stable&lt;/id&gt;
+ &lt;url>http://code.grobmeier.de/mvn/stable&lt;/url&gt;
+ &lt;/repository&gt;
+ &lt;/repositories&gt;
+ </source>
+
+ <p>Then add the following dependency to your project</p>
+
+ <source>
+ &lt;dependency&gt;
+ &lt;groupId&gt;de.grobmeier.json&lt;/groupId&gt;
+ &lt;artifactId&gt;jjson&lt;/artifactId&gt;
+ &lt;version&gt;0.1.0&lt;/version&gt;
+ &lt;/dependency&gt;
+ </source>
+
+ </section>
+
+ <section name="Manual Install">
+ <p>
+ Just drop the jar-File(s) into your projects classpath and go for it. At the moment there is no maven repository available online,
+ but this is in the works.
+ </p>
+ </section>
+
+ <section name="Install the Struts 2 Plugin">
+ Install the JsonResult? class in your struts.xml package:
+
+ <source>
&lt;result-types&gt;
&lt;result-type name="json" class="de.grobmeier.json.plugins.struts2.JsonResult"/&gt;
&lt;/result-types&gt;
- </source>
+ </source>
- Then you can use this result type like that:
+ Then you can use this result type like that:
- <source>
+ <source>
&lt;action name="doSomething" class="de.grobmeier.DoSomething"&gt;
&lt;result type="json" /&gt;
&lt;/action&gt;
- </source>
+ </source>
- The result is a json string.
+ The result is a json string.
- Please note, everything you want in your JSON string must be annotated with @JSON, even the Action class it self.
+ Please note, everything you want in your JSON string must be annotated with @JSON, even the Action class it self.
- <source>
+ <source>
-@JSON
-class DoSomething {
- @JSON public String myString = "test";
- @JSON public String myString2 = "test2";
- // GETTER necessary like getMyString()
-}
- </source>
+ @JSON
+ class DoSomething {
+ @JSON public String myString = "test";
+ @JSON public String myString2 = "test2";
+ // GETTER necessary like getMyString()
+ }
+ </source>
- This will return {"myString" : "test", "myString2" : "test2"}
+ This will return {"myString" : "test", "myString2" : "test2"}
- Fields need matching getter methods.
+ Fields need matching getter methods.
- You can even annotate methods instead of the fields, if you would like to to return a object created on the fly:
+ You can even annotate methods instead of the fields, if you would like to to return a object created on the fly:
- <source>
+ <source>
-@JSON
-class DoSomething {
- @JSON public void blub() { return "test"; }
-}
- </source>
+ @JSON
+ class DoSomething {
+ @JSON public void blub() { return "test"; }
+ }
+ </source>
- This will return {"blub" : "test"}
- </section>
+ This will return {"blub" : "test"}
+ </section>
- </body>
+ </body>
</document>
Please sign in to comment.
Something went wrong with that request. Please try again.