My play project is massive and the routes file is approx 1Mb. Now, when scala compiles, I have the exception \"Method code too large\" because of the routing and the reverse
Well, the first method is working. I started from scratch and it worked. I did a clean command before the compile command. It seems that old compiled files were the cause of my problem.
Be careful to note that you cannot have an overlap in package names in the routes files. E.g. in this example, the technical.routes
file contains all routes in the controllers.technical
and the main routes file cannot contain any routes in the controllers.technical
package.
conf/routes
contents:
# Routes
# This file defines all application routes (Higher priority routes first)
# ~~~~
-> /technical technical.Routes
GET / controllers.Dashboard.index()
conf/technical.routes
contents:
# Routes
# ~~~~
GET / controllers.technical.App.index()
If your file name is technical.routes, while including the file, mention technical.Routes (caps).
The parameter after -> is the url prefix, so to access any url of technical.routes file, you need to add the prefix.
http://127.0.01/technical/{defined url in technical.routes file}