Rapidoid - Extremely Fast, Simple and Powerful Java Web Framework!

Open source (Apache license). View benchmark... Community: [email protected]

Serving static files
  • The default locations for serving static files are default/static and static.
  • All resources that exist in these folders will be automatically served when requested.
  • The static location has precedense over the default/static location.
Main.java
import org.rapidoid.setup.On;
 
public class Main {
 
    public static void main(String[] args) {
        On.get("/").html("Home");
    }
 
}
c.html
Hello from C!
static/a.html
Hello from A!
static/b.html
Hello from B!
GET /
Home
GET /a.html
Hello from A!
GET /b.html
Hello from B!
GET /c.html
404 Not found!

HTTP server routes information:

Verb Path Zone Content type MVC View name Roles
GET / main html