When we say Oorian enables "pure Java" web development, we mean something specific: your entire application—UI included—is written in Java. No HTML templates. No JavaScript. No context switching. This article explores why this matters.
One Language, One Paradigm
Traditional web development requires multiple languages:
- Java for backend logic
- HTML for structure
- CSS for styling
- JavaScript for interactivity
- Template languages (Thymeleaf, JSP, etc.)
Each language has its own paradigm, tooling, and quirks. With Oorian, everything is Java:
@Page("/dashboard")
public class DashboardPage extends HtmlPage
{
@Override
protected void createBody(Body body)
{
// Structure
Div container = new Div();
container.setPadding("20px");
// Styling
H1 title = new H1();
title.setText("Dashboard");
title.setColor("#1f2937");
title.setFontWeight("700");
container.addElement(title);
// Interactivity
Button refresh = new Button("Refresh");
refresh.registerListener(this, MouseClickedEvent.class);
container.addElement(refresh);
body.addElement(container);
}
}
Full IDE Support
Because everything is Java, your IDE can help with everything:
- Autocomplete: Every element property is discoverable
- Refactoring: Rename a component class and all references update
- Navigation: Jump to definition, find usages
- Error detection: Compile-time errors, not runtime surprises
Compare this to hunting for a typo in an HTML attribute or a JavaScript callback name.
Type Safety End-to-End
// This won't compile if the method doesn't exist
button.setBackgroundColor("#2563eb");
// This won't compile if the event type is wrong
button.registerListener(this, MouseClickedEvent.class);
// This won't compile if the data types don't match
grid.setRowData(customerList); // List<Customer>
Type safety extends from your database entities through your business logic to your UI. The compiler catches errors that would be runtime bugs in template-based systems.
OOP for UI
Pure Java means full object-oriented programming for your UI:
Inheritance
public abstract class CrudPage<T> extends HtmlPage
{
protected abstract void configureGrid(AgGrid grid);
protected abstract T createEntity();
protected abstract void saveEntity(T entity);
@Override
protected final void createBody(Body body)
{
body.addElement(createToolbar());
body.addElement(createGrid());
body.addElement(createForm());
}
}
public class CustomerPage extends CrudPage<Customer>
{
@Override
protected void configureGrid(AgGrid grid)
{
grid.addColumn("name", "Name");
grid.addColumn("email", "Email");
}
}
Composition
public class AddressForm extends Div
{
private TextInput street;
private TextInput city;
private TextInput zipCode;
public AddressForm()
{
street = new TextInput();
city = new TextInput();
zipCode = new TextInput();
// Layout and styling
}
public Address getAddress()
{
return new Address(
street.getValue(),
city.getValue(),
zipCode.getValue()
);
}
}
// Reuse anywhere
AddressForm billingAddress = new AddressForm();
AddressForm shippingAddress = new AddressForm();
Polymorphism
public interface Validatable
{
boolean validate();
List<String> getErrors();
}
public class CustomerForm extends Div implements Validatable
{
@Override
public boolean validate()
{
// Customer-specific validation
}
}
// Generic handling
private void saveForm(Validatable form)
{
if (!form.validate())
{
showErrors(form.getErrors());
return;
}
// Proceed with save
}
Debugging Made Simple
Set a breakpoint in your event handler. Step through your UI logic. Inspect element state. It's just Java debugging—no browser developer tools, no console.log, no guessing.
Conclusion
Pure Java development isn't just about avoiding JavaScript. It's about applying decades of software engineering best practices—type safety, OOP, IDE tooling, debugging—to web development. Oorian makes this possible without sacrificing UI quality or interactivity.