Adding a Scala Module to an Existing Java Project

So I have a pretty big game! project using standard Java material. I want to start using Scala and thought I could combine the two. I installed the Scala module and added a configuration line. Then I added a new controller:

package controllers

import play.mvc._

object Blog extends Controller {
  def index = "test"
}

But when I restart the server and try to go to http: // localhost: 9000 / Blog / index , I get a "Blog.index action not found"

Is there anything else I need to do to add Scala support for this project, or do I need to create a new project using Scala from get go and copy all the files?

UPDATE

routes:

# Routes
# This file defines all application routes (Higher priority routes first)
# ~~~~

# Home page
GET     /explorer                               Application.index
GET     /signup                                 Application.signUp
POST    /register                               Application.register
GET     /tour                                   Main.tour
GET     /                                       Main.homePage

# Map static resources from the /app/public folder to the /public path
GET     /public/                                staticDir:public

*       /admin                                  module:crud

# Catch all
*       /                                       module:secure
*       /{controller}/{action}                  {controller}.{action}

magazines:

@65kk1d8dn
Blog.index action not found

Action not found
Action Blog.index could not be found. Error raised is Controller controllers.Blog not found

play.exceptions.ActionNotFoundException: Action Blog.index not found
    at play.mvc.ActionInvoker.getActionMethod(ActionInvoker.java:447)
    at play.mvc.ActionInvoker.invoke(ActionInvoker.java:78)
    at Invocation.HTTP Request(Play!)
Caused by: java.lang.Exception: Controller controllers.Blog not found
    ... 3 more
+3
source share
2 answers

? /? - ?

, , , ?

EDIT ( ):

mm , - Windows ( , ). Play Google, Windows. Scala "", , . Play.

+3

- * Blog.index, Blog$.index().

  • - , Scala JVM.
+3

All Articles