Menu Chiudi


Java Object Representation

JOR is used to represent objects on the web, then to format them in html, and therefore to associate a given URL to an object. To do this, write down the desired class with this super annotation:

@JOR(field_id = "title", url_Pattern = "books/")

In this case, if the book is called makado, to trace this object, once the jor web server has been activated, go to the url http: // localhost / books / makado.

Let’s see the first example JOR, we want to represent books on the web, let’s see how to do :
  1. I create the Book class:
    package cloud.jgo.test;


    @author Martire91  <>

    (field_id = "title", url_Pattern = "books/")
    public class Book {

    private String title, author;
    private double price;

    public Book() {
    this.title = null;
        = null;
    this.price = 1;

    public Book(String title, String author, double price) {
    this.title = title;
        = author;
    this.price = price;

    public String getTitle() {
    return title;

    public void setTitle(String title) {
    this.title = title;

    public String getAuthor() {
    return author;

    public void setAuthor(String author) {
        = author;

    public double getPrice() {
    return price;

    public void setPrice(double price) {
    this.price = price;

  2. I create the jor request handler

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *