Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ActiveWeb: Implement an exclusive routing flag #1094

Closed
ipolevoy opened this issue Apr 6, 2021 · 1 comment
Closed

ActiveWeb: Implement an exclusive routing flag #1094

ipolevoy opened this issue Apr 6, 2021 · 1 comment

Comments

@ipolevoy
Copy link
Member

ipolevoy commented Apr 6, 2021

Currently you can add custom routs to the RouteConfig class: https://javalite.io/routing, but the standard routes are still open. The idea is to add an exclusive flag:

public class RouteConfig extends AbstractRouteConfig {
    public void init(AppContext appContext) {
        exclusiveRoutes();    // <--------------------------------- shuts off all standard routes
        route("/myposts").to(PostsController.class);
        route("/{action}/{controller}/{id}");
        route("/{action}/greeting/{name}").to(HelloController.class);
    }
}

so that if added, only custom routes would work. All standard routes would generate a 404.

@ipolevoy
Copy link
Member Author

Rename "exclusive" to "strict" - a more appropriate term for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant