Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

101 lines (80 sloc) 3.135 kB
<?xml version="1.0" encoding="UTF-8"?>
<document xmlns=""
<title>JJSON - A JSON Library for Java without dependencies</title>
<author email="">Christian Grobmeier</author>
<!-- Optional HEAD element, which is copied as is into the XHTML <head> element -->
<style type="text/css">
h2 {
font-size: 50px;
<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>Then add the following dependency to your project</p>
<section name="Manual Install">
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.
<section name="Install the Struts 2 Plugin">
Install the JsonResult? class in your struts.xml package:
&lt;result-type name="json" class="de.grobmeier.json.plugins.struts2.JsonResult"/&gt;
Then you can use this result type like that:
&lt;action name="doSomething" class="de.grobmeier.DoSomething"&gt;
&lt;result type="json" /&gt;
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.
class DoSomething {
@JSON public String myString = "test";
@JSON public String myString2 = "test2";
// GETTER necessary like getMyString()
This will return {"myString" : "test", "myString2" : "test2"}
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:
class DoSomething {
@JSON public void blub() { return "test"; }
This will return {"blub" : "test"}
Jump to Line
Something went wrong with that request. Please try again.