This tutorial provides step-by-step guidelines to change the routing of the web server we've created earlier with annotations.
1.Delete Routing
First, we must delete the old routing. Delete the AppRouteConfig interface and the AppRouteConfigImpl class. You will get the following warning:
Now delete the MainApplication class and the Application interface. Open the Main class and you should see this:
Delete those lines. Now remove the AppRouteConfig from the ServerImpl and ServerRouteConfigImpl constructors. From the ServerRouteConfigImpl delete the initializeServerConfig() and parseRoute() methods. Now the server should be able to start:
Now we need to create the new routing.
In the server.routing package, create the following annotation:
We will use this to identify our controllers later on. Only classes with this annotation will be able to declare routings.
|