Quick Start Guide

1. Prerequisites

Before you begin, ensure you have the following installed:

LaunchPad (Recommended)

  • Java Development Kit (JDK) 17 or higher — Oorian requires JDK 17 as its baseline
  • An IDE — NetBeans, IntelliJ IDEA, Eclipse, or VS Code

That's it! LaunchPad includes an embedded Jetty server, so no external servlet container is needed.

App Server

  • Java Development Kit (JDK) 17 or higher — Oorian requires JDK 17 as its baseline
  • An IDE — NetBeans, IntelliJ IDEA, Eclipse, or VS Code
  • A Servlet Container — Tomcat 10+, Jetty 11+, GlassFish 7+, or WildFly 27+
Library Architecture

The core framework is packaged as oorian-core.jar. LaunchPad bundles it with an embedded Jetty server. Extension and add-on libraries are separate JARs you add to your project as needed.

2. Download a Starter Project

Starter projects are pre-configured ZIPs with your IDE's project files, the Oorian library, and a sample page. Download one, open it in your IDE, and you're ready to go.

LaunchPad Starters (Recommended)

LaunchPad includes an embedded Jetty server — no external servlet container needed. Just run the application's main() method from your IDE and open a browser. This is the easiest way to get started with Oorian.

Download a LaunchPad starter for your IDE from the Downloads page.

App Server Starters

For developers already using Tomcat, Jetty, GlassFish, or WildFly in their development environment. These starters produce a standard WAR file that deploys to your existing servlet container.

Download an App Server starter for your IDE from the Downloads page.

3. Project Structure

Your starter project is ready to run out of the box. Here's what's inside and what each piece does.

LaunchPad Projects

LaunchPad projects are standard Java applications that produce a JAR. The embedded Jetty server is included as a dependency — no external servlet container is needed.

Project Layout
OorianQuickLaunchApp/
├── pom.xml                              # Build configuration
├── src/main/java/com/oorian/quicklaunch/
│   ├── QuickLaunchApp.java              # Launcher with main() method
│   ├── MyWebApp.java                    # Oorian Application class
│   └── HomePage.java                    # Sample page (@Page)
└── web/
    ├── oorian.min.js                        # Oorian JavaScript bridge
    ├── logo.png                             # Sample static resource
    └── WEB-INF/
        ├── oorian.properties                # Application configuration
        └── oorian-dev.properties            # Dev environment overrides
File Purpose
QuickLaunchApp.java Entry point — creates a LaunchPad instance and starts the embedded server
MyWebApp.java Your Application subclass — registers packages and configures the app
HomePage.java A sample @Page class with interactive button demo
web/ Static resources (JS, CSS, images) — served directly by the embedded server
WEB-INF/oorian.properties Application configuration (loaded automatically by Oorian)

App Server Projects

App Server projects are Java web applications that produce a WAR file for deployment to an external servlet container like Tomcat.

Project Layout
OorianQuickStartApp/
├── pom.xml                              # Build configuration
├── src/main/java/com/oorian/quickstart/
│   ├── OorianQuickStartApp.java         # Oorian Application class
│   └── MyPage.java                      # Sample page (@Page)
└── src/main/webapp/
    ├── oorian.min.js                        # Oorian JavaScript bridge
    └── WEB-INF/
        ├── web.xml                          # Servlet container configuration
        ├── oorian.properties                # Application configuration
        └── oorian-dev.properties            # Dev environment overrides
File Purpose
OorianQuickStartApp.java Your Application subclass — registers packages and configures the app
MyPage.java A sample @Page class
webapp/ Web application root — static resources and WEB-INF configuration
WEB-INF/web.xml Servlet container descriptor
WEB-INF/oorian.properties Application configuration (loaded automatically by Oorian)

4. The Oorian Application Class

Every Oorian application needs an Application subclass annotated with @WebListener. This class is the same whether you use LaunchPad or an app server. It has two lifecycle methods:

  • initialize() — The entry point, called when your application starts
  • destroy() — The exit point, called when your application shuts down
Java — MyApplication.java
package com.yourcompany;

import com.oorian.Application;
import com.oorian.AppContext;
import jakarta.servlet.annotation.WebListener;

@WebListener
public class MyApplication extends Application
{
    @Override
    protected void initialize(AppContext appContext)
    {
        registerPackage("com.yourcompany.pages");
    }

    @Override
    protected void destroy(AppContext appContext)
    {
        // Clean up resources if needed
    }
}

At a minimum, your initialize() method must call registerPackage() to tell Oorian where your page classes live. Oorian scans the registered package and all sub-packages for classes annotated with @Page.

LaunchPad Launcher

LaunchPad projects also need a separate launcher class with a main() method. This is the class you run from your IDE to start the embedded server.

Java — MyLauncher.java
package com.yourcompany;

import com.oorian.launchpad.LaunchPad;

public class MyLauncher
{
    public static void main(String[] args)
    {
        LaunchPad launcher = new LaunchPad();
        launcher.launch(MyApplication.class);
    }
}

App Server projects don't need a launcher class — the servlet container discovers your @WebListener Application class automatically.

Tip

You can register multiple packages if your application spans different namespaces, but you only need to register the top-level package. Sub-packages are scanned automatically.

5. Your First Page

Pages in Oorian are Java classes that extend HtmlPage and are annotated with @Page.

Java
package com.yourcompany.pages;

import com.oorian.annotations.Page;
import com.oorian.html.HtmlPage;
import com.oorian.html.elements.*;

@Page("/")
public class HomePage extends HtmlPage
{
    @Override
    protected void createHead(Head head)
    {
        head.setTitle("My First Oorian App");
    }

    @Override
    protected void createBody(Body body)
    {
        H1 heading = new H1();
        heading.setText("Hello, Oorian!");
        body.addElement(heading);

        P paragraph = new P();
        paragraph.setText("Welcome to your first Oorian application.");
        body.addElement(paragraph);
    }
}

The @Page("/") annotation maps this page to the root URL. When you deploy and visit your application, you'll see this page.

6. Running Your Application

LaunchPad

Run the main() method in your Launcher class from your IDE. LaunchPad starts an embedded Jetty server and prints the URL to the console:

Console Output
Oorian LaunchPad started: http://localhost:8080

Open http://localhost:8080 in your browser to see your application.

Hot Reload

LaunchPad supports hot reload in development. When you recompile your code, LaunchPad detects the changes and reloads automatically — no manual restart needed.

App Server

Deploy the WAR file to your servlet container. In most IDEs, click Run to build, deploy, and open the application in your browser automatically.

  • NetBeans — Right-click the project and choose Run. NetBeans deploys to the configured Tomcat instance.
  • IntelliJ IDEA — Create a Tomcat run configuration and click Run.
  • Eclipse — Right-click the project, choose Run As → Run on Server.
  • VS Code — Use the Tomcat for Java extension to deploy and run.

7. Working with HTML Elements

Oorian provides Java classes for all standard HTML elements. Each element has type-safe methods for setting attributes and styles.

Common Elements

HTML Tag Oorian Class Example Usage
<div> Div new Div()
<span> Span new Span()
<p> P new P()
<a> A or Anchor new A("/about")
<button> Button new Button()
<img> Image new Image("/logo.png")
<h1>-<h6> H1-H6 new H1()
<table> Table new Table()
<input> TextInput, Checkbox, etc. new TextInput()
<select> Select new Select()

Setting Styles

Elements provide type-safe methods for common CSS properties:

Java
Div container = new Div();
container.setWidth("800px");
container.setMargin("0 auto");
container.setPadding("20px");
container.setBackgroundColor("#f8fafc");
container.setBorderRadius("12px");

// Use CSS enums for type safety
container.setDisplay(Display.FLEX);
container.setFlexDirection(FlexDirection.COLUMN);
container.setAlignItems(AlignItems.CENTER);

Nesting Elements

Build your UI by nesting elements:

Java
Div card = new Div();
card.setBackgroundColor("#ffffff");
card.setPadding("24px");
card.setBorderRadius("8px");

H3 title = new H3();
title.setText("Welcome");
card.addElement(title);

P content = new P();
content.setText("This is a card component.");
card.addElement(content);

body.addElement(card);