My favorites | Sign in
nop
Project Home Downloads Wiki Issues Source
Project Information
Members

What is this?

Nop is an MVC web framework for Java. There are a lot of web frameworks. So why do we need another one? Most of Java web frameworks are not for writing web-sites. They are for enterprise. They usually include hundreds megabytes of dependencies. You often should rebuild and redeploy your web application to just test small source code changes. There is the Play! framework which has not these disadvantages, but it is inflexible.

Nop is as lightweight and comfortable as Play, but it is more flexible. With Nop you are to write a little more code, but this code is type-safe, fast and reusable.

What does it include?

  • Template engine.
  • Bi-directional URL-to-controller mapping.
  • XML-RPC support (also JSON-RPC support is planned).
  • Localization support.
  • Database refactoring (migration).
  • SQL builder.
  • JVM bytecode to JavaScript decompiler.
  • Starting either as standalone application or by deploying on servlet container.
  • Actors both at server and at browser.

How to try?

You can download distribution here. Extract the archive and create the modules folder near the nop.all.jar file. Copy the demo/forum/nop.forum.jar' into the modules` folder. In command line type:

java -jar nop.all.jar

Open your browser and in the address bar enter 'http://localhost:8080'. To log in use root both as login and password.

How to learn?

To learn how to write a web application using Nop, read this:

To learn Nop components' features, read these articles:

Strong points

Template engine

The template engine is very fast and type safe. It compiles templates and gives diagnostic messages on startup. Templates are compiled right into JVM bytecode. A template itself is a well-formed XML file. You can extend the template engine by writing your own tag libraries. From embedded expressions you can invoke any method with any parameter set.

URL-to-controller mapping

The mapper uses prefix trees. It does not match every rule with an URL. It uses only one pass instead. The mapper is bi-directional, so not only URLs are translated to method calls, but you can call method to get URL.

XML-RPC support

Nop supports both XML-RPC client and server. To make interface methods available through XML-RPC protocol, you just add annotations, no anything else for mapping. To create a service implementation, you just write a class which implements service's interface. To call remote methods, you just get call methods of interface. Just like with JAX-WS.

SQL builder

The SQL builder uses a LinQ-like language based on fluent interface. It is rather expressive and supports most of SQL features. It generates DBMS-specific queries for you. It saves you from embedding SQL queries into your Java code as strings. It allows you to esily generate complex dynamic queries.

JVM bytecode to JavaScript decompiler.

The decompiler, unlike GWT, uses bytecode, not Java source code, to produce JavaScript. So you don't need any special compilers and IDE plugins to write client code in Java. Is also allows you to mix server and client code in one project and even in one class. For example, you can bind submit button to your controller's foo() method. Depending on server settings and browser capabilities there are two ways to execute foo():

  1. Browser sends POST request to server. Server executes foo() and renders response.
  2. Browser calls foo() method, produced with the decompiler.

The decompiler produces rather clean JavaScript code, very similar to original Java source code.

For now it is used just to decompile form validation code.

Powered by Google Project Hosting