Reputation: 577
I am a beginner to Play framework and Scala, I'm trying to develop a simple web project with Play on Scala, I'm using the eclipse IDE!
My problem is when I change the parameter of a view template, despite the fact that I pass the "same new" parameter in the Action calling this view, I have an error like this:
type mismatch; found : Int required: String
To simplify, assuming we have a view that takes as parameter @(value:String)
so I can call this view from an Action Ok(html.say(value))
such as value is declared as String.
In this case, all is well!
But when I change the parameter of the view to take an Int @(value:Int)
and I call this view from the Action with Ok(html.say(value))
despite I changed the type of value from String to Int, I get:
Compilation error: type mismatch; found : Int required: String
I did a clean on the project but it didn't help. What is the problem?
Upvotes: 1
Views: 2026
Reputation: 2189
Before posting any questions on Play Framework "play clean compile" command should be run. It resolves 95% of such issues.
Upvotes: 2
Reputation: 11244
Make sure you compile from the Play console, either by typing compile
or by reloading your page (when you are running the application). That will recompile the template. Then you can refresh Eclipse to make it pick up the changes.
Upvotes: 2